-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
#66631 adds iterator forms of several existing reflection APIs. We should add a modernizer to rewrite the non-iterator forms to the iterator forms when used in a simple loop.
Example rewrite:
var v Value
for i := range v.NumFields() {
f := v.Field(i)
// ... use f ...
// Optional:
sf := v.Type().Field(i)
// ... use sf ...
}var v Value
for sf, f := range v.Fields() {
// ... use f and sf ...
}Metadata
Metadata
Assignees
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.