proposal: cmd/go: 'go mod tidy' should remove stale 'replace' directives #30516
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Proposal
Projects
Milestone
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 env
OutputWhat did you do?
I created a
go.mod
file with two replaces in separate lines, then rungo mod tidy
.foo3
replacement is unused.What did you expect to see?
A nicely formatted
go.mod
. Moreover, I think the unused replace should be removed.What did you see instead?
The file is unchanged. Also,
go mod edit -fmt
does not format replaces.The text was updated successfully, but these errors were encountered: