-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.RefactoringIssues related to refactoring toolsIssues related to refactoring toolsgopls/imports
Milestone
Description
The mapsloop transformation discards comments:
diff --git a/src/go/doc/reader.go b/src/go/doc/reader.go
index e84d6d9a71..6e8c682087 100644
--- a/src/go/doc/reader.go
+++ b/src/go/doc/reader.go
- for name, f := range t.funcs {
- // in a correct AST, package-level function names
- // are all different - no need to check for conflicts
- r.funcs[name] = f
- }
+ maps.Copy(r.funcs, t.funcs)
Until recently, minmax
used to do the same (#72727). We should apply a similar fix, here and anywhere else that discards a block.
Metadata
Metadata
Assignees
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.RefactoringIssues related to refactoring toolsIssues related to refactoring toolsgopls/imports