-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Not planned
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.GoCommandcmd/gocmd/goToolProposalIssues 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
Description
Go version
go version go1.24.3 linux/amd64
Output of go env
in your module/workspace:
n/a
What did you do?
'go get -u ' resulted in automatically adding a toolchain line to go.mod
I wanted to remove it again, using 'go mod edit' so the update and follow-up were reproducible as a CLI command for later re-use.
What did you see happen?
'go mod edit' has flags to do almost any other transformation of a go.mod you might want, including '-toolchain' for adding a toolchain. Pretty much every other flag has a '-dropXXX' equivalent.
What did you expect to see?
But '-droptoolchain' is missing.
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.GoCommandcmd/gocmd/goToolProposalIssues 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
Projects
Milestone
Relationships
Development
Select code repository
Activity
gabyhelp commentedon May 16, 2025
Related Issues
Related Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
[-]go mod edit: Lacks -droptoolchain flag[/-][+]cmd/go: mod edit: missing -droptoolchain flag[/+]mknyszek commentedon May 16, 2025
CC @golang/command-line
gopherbot commentedon May 19, 2025
Change https://go.dev/cl/674075 mentions this issue:
cmd/go: mod edit: add -droptoolchain flag
matloob commentedon May 27, 2025
go mod edit
is mainly intended to be used by tools. For users, the way to remove the toolchain directive isgo get toolchain@none
. Maybe we should improve the documentation about this?matloob commentedon May 27, 2025
I should also add that in Go 1.25, the go command will add the toolchain line in fewer instances. Running
go get -u
won't add a toolchain directive.