Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: inconsistent reporting of default Go version #70090

Open
rsc opened this issue Oct 29, 2024 · 3 comments
Open

cmd/go: inconsistent reporting of default Go version #70090

rsc opened this issue Oct 29, 2024 · 3 comments
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@rsc
Copy link
Contributor

rsc commented Oct 29, 2024

In the transcript below, there is no go line in the go.mod.
Builds say I can't use post-Go 1.16 features, but then when I say
"go get go@1.21.0" (using a sufficiently old version so as not to break any users),
it claims I am downgrading from Go 1.24.

% go install
# rsc.io/tmp/jsonfmt
./jsonfmt.go:95:9: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
% cat go.mod
module rsc.io/tmp/jsonfmt
% go get go@go1.21.0
go: downgraded go 1.24 => 1.21.0
go: added toolchain go1.24
% cat go.mod
module rsc.io/tmp/jsonfmt

go 1.21.0

toolchain go1.24
% 
@cagedmantis cagedmantis added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Oct 29, 2024
@cagedmantis
Copy link
Contributor

cc @matloob @samthanawalla

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/624635 mentions this issue: cmd/go: check missing go line in go.mod when 'go get go@1.N.P'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants