Alan Donovan submitted the change![Open in Gerrit]()
Unreviewed changes
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
Change information
Commit message:
go/analysis/passes/modernize: stditerators: better name heuristic
This change causes stditerators' name heuristic to choose the
name v from a function body of this form:
for i := 0; i < x.Len(); i++ {
if v := x.At(i); cond { ... }
}
The fix may result in the degenerate
for v := range x.All() {
if v := v; cond { ... }
}
so the forvar analyzer has been taught to recognise this
pattern too (see parent CL).
Updates golang/go#76240
Updates golang/go#76241
Change-Id: I8888fea5adce3e5f55002abadd16527f877e3389
Files:
- M go/analysis/passes/modernize/stditerators.go
- M go/analysis/passes/modernize/testdata/src/stditerators/stditerators.go
- M go/analysis/passes/modernize/testdata/src/stditerators/stditerators.go.golden
Change size: M
Delta: 3 files changed, 47 insertions(+), 6 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Robert Findley
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I8888fea5adce3e5f55002abadd16527f877e3389
Gerrit-Change-Number: 719361
Gerrit-PatchSet: 4