Go version
go version go1.26.1 linux/amd64
Output of go env in your module/workspace:
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='0'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/zlatko/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/zlatko/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1087837356=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/tmp/bug/go.mod'
GOMODCACHE='/home/zlatko/go/pkg/mod'
GONOPROXY=''
GONOSUMDB='REDACTED'
GOOS='linux'
GOPATH='/home/zlatko/go'
GOPRIVATE=''
GOPROXY='REDACTED'
GOROOT='/home/zlatko/.gobrew/current/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/zlatko/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/zlatko/.gobrew/current/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.26.1'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
go.mod
module example.com/bug
go 1.26
main.go:
https://go.dev/play/p/BcNiWkxRNbA
go fix wants to apply four fixes simultaneously:
stringsseq : strings.Split -> strings.SplitSeq (returns iter.Seq[string] instead of []string)
stringscutprefix : strings.HasPrefix + strings.TrimPrefix -> strings.CutPrefix
stringsseq : Inner strings.Split -> strings.SplitSeq
slicescontains : for _, item := range slice { if item == target } -> slices.Contains(slice, target)
Fixes 3 and 4 conflict:
- Fix 3 changes
strings.Split(parts[1], ",") to strings.SplitSeq(...), which returns iter.Seq[string]
- Fix 4 wants to replace the loop with
slices.Contains(strings.Split(parts[1], ","), target), which requires ~[]E (a slice)
When both are pending, go fix applies 3 of the 4, skips the conflicting one, and tells you to re-run. But the next run faces the same conflict and applies 3 of 4 again, in a cycle.
What did you see happen?
$ go fix ./...
# example.com/bug
# [example.com/bug]
fix: applied 3 of 4 fixes; 1 file updated. (Re-run the command to apply more.)
$ go fix ./...
# example.com/bug
# [example.com/bug]
fix: applied 3 of 4 fixes; 1 file updated. (Re-run the command to apply more.)
$ go fix ./...
# example.com/bug
# [example.com/bug]
fix: applied 3 of 4 fixes; 1 file updated. (Re-run the command to apply more.)
no change in code
What did you expect to see?
I expected some improvements but nothing is changed
Go version
go version go1.26.1 linux/amd64
Output of
go envin your module/workspace:What did you do?
go.mod
main.go:
https://go.dev/play/p/BcNiWkxRNbA
go fixwants to apply four fixes simultaneously:stringsseq:strings.Split->strings.SplitSeq(returnsiter.Seq[string]instead of[]string)stringscutprefix:strings.HasPrefix+strings.TrimPrefix->strings.CutPrefixstringsseq: Innerstrings.Split->strings.SplitSeqslicescontains:for _, item := range slice { if item == target }->slices.Contains(slice, target)Fixes 3 and 4 conflict:
strings.Split(parts[1], ",")tostrings.SplitSeq(...), which returnsiter.Seq[string]slices.Contains(strings.Split(parts[1], ","), target), which requires~[]E(a slice)When both are pending,
go fixapplies 3 of the 4, skips the conflicting one, and tells you to re-run. But the next run faces the same conflict and applies 3 of 4 again, in a cycle.What did you see happen?
no change in code
What did you expect to see?
I expected some improvements but nothing is changed