-
Notifications
You must be signed in to change notification settings - Fork 19k
cmd/go: never remove the toolchain directive when tidying #75331
Copy link
Copy link
Open
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.
Milestone
Metadata
Metadata
Assignees
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.
Type
Fields
Give feedbackNo fields configured for issues without a type.
When the
goandtoolchaindirectives are equal,go mod tidyremoves thetoolchaindirective, which in my opinion, "removes the intent" of managing the toolchain version with thego.modfile.When that happens, tools like dependency update automation (e.g. Dependabot, Renovate) will stop updating the Go version of the project (since the
godirective is the minimal supported version, it is not usually desirable to update with the same frequency). And these tools will not add it back since they cannot tell whatever the user wishes to usetoolchain, the "intent" has been removed.The
godirective often gets bump bygo mod tidywhen a dependency requires it, which happens fairly often.The current behavior adds extra work for the user to keep an eye on the presence of the
toolchaindirective in theirgo.modfile, to add it back when there is a new release. Possibly allowing CVEs to accumulate if they do not notice or forget.Basically, when a user has opted into using
toolchain, they should never be opted out bygo mod tidy.Would that sound like reasonable change for
go mod tidy?