[tools] go/analysis/passes/modernize: stringsbuilder: avoid overlapping fixes

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Dec 29, 2025, 3:22:44 PM (15 hours ago) Dec 29
to Alan Donovan, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Madeline Kalil, Go LUCI, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
go/analysis/passes/modernize: stringsbuilder: avoid overlapping fixes

This CL causes stringsbuilder to offer at most one fix overlapping
a given point (ignoring import edits).

This fixes the immediate problem of conflicts in stringsbuilder (#76983)
but is only a partial mitigation of the more general problem of
textually non-conflicting edits that nonetheless conflict either
syntactically (as in this case) or semantically (as happens when,
say, the composition of two fixes renders a local variable unused),
which is golang/go#76476.

+ test

Fixes golang/go#76983
Updates golang/go#76476
Change-Id: I2251a88580319dfac2841c22daee56b1c4936990
Auto-Submit: Alan Donovan <adon...@google.com>
Commit-Queue: Alan Donovan <adon...@google.com>
Reviewed-by: Madeline Kalil <mka...@google.com>
Files:
  • M go/analysis/passes/modernize/stringsbuilder.go
  • M go/analysis/passes/modernize/testdata/src/stringsbuilder/stringsbuilder.go
  • M go/analysis/passes/modernize/testdata/src/stringsbuilder/stringsbuilder.go.golden
Change size: M
Delta: 3 files changed, 86 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Madeline Kalil
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
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: I2251a88580319dfac2841c22daee56b1c4936990
Gerrit-Change-Number: 733102
Gerrit-PatchSet: 3
Gerrit-Owner: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages