What version of Go are you using (go version)?
$ go version
go version go1.12 windows/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPROXY=
set GORACE=
set GOTMPDIR=
What did you do?
I created a go.mod file with two replaces in separate lines, then run go mod tidy. foo3 replacement is unused.
replace foo => bar
replace foo2 => bar2
replace foo3 => bar3
What did you expect to see?
A nicely formatted go.mod. Moreover, I think the unused replace should be removed.
replace (
foo => bar
foo2 => bar2
)
What did you see instead?
The file is unchanged. Also, go mod edit -fmt does not format replaces.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
I created a
go.modfile with two replaces in separate lines, then rungo mod tidy.foo3replacement is unused.What did you expect to see?
A nicely formatted
go.mod. Moreover, I think the unused replace should be removed.replace ( foo => bar foo2 => bar2 )What did you see instead?
The file is unchanged. Also,
go mod edit -fmtdoes not format replaces.