Skip to content

cmd/go: -help and go version are broken when go.mod contains non-standard version #60956

@thaJeztah

Description

@thaJeztah

What version of Go are you using (go version)?

$ go version
go: downloading go1.22-schrodingers-version-yall (linux/arm64)
go: download go1.22-schrodingers-version-yall for linux/arm64: toolchain not available

Does this issue reproduce with the latest release?

See above

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
go: downloading go1.22-schrodingers-version-yall (linux/arm64)
go: download go1.22-schrodingers-version-yall for linux/arm64: toolchain not available

What did you do?

go mod init foo
sed -i 's/1.21rc2/1.22-schrodingers-version-yall/g' go.mod

go --help
go: downloading go1.22-schrodingers-version-yall (linux/arm64)
go: download go1.22-schrodingers-version-yall for linux/arm64: toolchain not available

go version
go: downloading go1.22-schrodingers-version-yall (linux/arm64)
go: download go1.22-schrodingers-version-yall for linux/arm64: toolchain not available

go --version
go: downloading go1.22-schrodingers-version-yall (linux/arm64)
go: download go1.22-schrodingers-version-yall for linux/arm64: toolchain not available
go mod init foo
sed -i 's/1.21rc2/1.22-schrödingers-version-yall/g' go.mod

go version
go: download go1.22-schrödingers-version-yall: non-semver module version "v0.0.1-go1.22-schrödingers-version-yall.linux-arm64"

go version --help
go: download go1.22-schrödingers-version-yall: non-semver module version "v0.0.1-go1.22-schrödingers-version-yall.linux-arm64"

What did you expect to see?

go --help
Go is a tool for managing Go source code.

Usage:

	go <command> [arguments]
# (etc)

go --version
flag provided but not defined: -version
Go is a tool for managing Go source code.

What did you see instead?

go: downloading go1.22-schrodingers-version-yall (linux/arm64)
go: download go1.22-schrodingers-version-yall for linux/arm64: toolchain not available

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions