[tools] go/analysis/passes/modernize: rangeint: result vars are implicit uses

0 views
Skip to first unread message

Alan Donovan (Gerrit)

unread,
Dec 18, 2025, 3:21:12 PM (21 hours ago) Dec 18
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Madeline Kalil, Kirill Kolyshkin, Go LUCI, golang-co...@googlegroups.com

Alan Donovan submitted the change

Change information

Commit message:
go/analysis/passes/modernize: rangeint: result vars are implicit uses

This CL fixes a bug in rangeint that caused it to make unsound
fixes because it failed to consider that result variables can be
implicit uses of a loop index variable after the loop, and thus
the fix to golang/go#71952 was insufficient.

+ test

Fixes golang/go#76880
Change-Id: I9c4d2082d93204023f50afb07318037d9134de23
TryBot-Bypass: Alan Donovan <adon...@google.com>
Auto-Submit: Alan Donovan <adon...@google.com>
Reviewed-by: Madeline Kalil <mka...@google.com>
Reviewed-by: Kirill Kolyshkin <koly...@gmail.com>
Commit-Queue: Alan Donovan <adon...@google.com>
Files:
  • M go/analysis/passes/modernize/rangeint.go
  • M go/analysis/passes/modernize/testdata/src/rangeint/rangeint.go
  • M go/analysis/passes/modernize/testdata/src/rangeint/rangeint.go.golden
Change size: S
Delta: 3 files changed, 44 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Kirill Kolyshkin, +2 by Madeline Kalil
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI, TryBot-Bypass+1 by Alan Donovan
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I9c4d2082d93204023f50afb07318037d9134de23
Gerrit-Change-Number: 731220
Gerrit-PatchSet: 2
Gerrit-Owner: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Kirill Kolyshkin <koly...@gmail.com>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages