-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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.
Description
When a tool is registered in go.mod with go get -tool
, ensure that the go
requirement is at least 1.24.0
. If that isn't the case, suggest to the user to upgrade (go mod edit -go=1.24.0
).
Rationale
go1.23 can't parse go.mod with a tool directive.
Go version
go version go1.24.5 darwin/arm64
Output of go env
in your module/workspace:
GO111MODULE=''
What did you do?
$ cat go.mod
module github.com/dolmen-go/goeval
go 1.23.0
require (
golang.org/x/mod v0.24.0
golang.org/x/tools v0.31.0
)
require golang.org/x/sync v0.12.0 // indirect
tool github.com/dolmen-go/goeval
What did you see happen?
go1.23.11 fails to parse a go.mod
that contains a tool
directive:
$ go1.23.11 build
go: errors parsing go.mod:
go.mod:12: unknown directive: tool
https://github.com/dolmen-go/goeval/actions/runs/16493582443/job/46633886516#step:4:7
What did you expect to see?
Either:
- go 1.23 to ignore the tool directive
- or go 1.24+
go get -tool
fails to add the tool and suggests to increase the minimum go version in go.mod (go mod edit -go=1.24.0
)
TapirLiu and dmitshur
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.