-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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 doesn't recognize forward go directive when tool section is present in go.mod #70949
Comments
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
you've explicitly asked that go not upgrade the toolchain for you. |
I don't think I did:
So where does the If I force it to
If According to https://go.dev/doc/toolchain:
Since I have- afaikt- the standard configuration this is not what seems to be happening here. |
check /opt/homebrew/Cellar/go/1.23.4/libexec/go.env |
|
Is not happening... |
that appears to be a homebrew issue https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/go.rb#L93 which deviates from upstream https://github.com/golang/go/blob/master/go.env |
see this line in particular https://github.com/Homebrew/homebrew-core/blob/b7a91605ef0a48dac1726cd989b429b3b0ca99c3/Formula/g/go.rb#L66 |
Thank you, that clarifies it. However, it is still confusing that
doesn't show this as changed. Seems |
yes, "standard" is defined by what's in go.env, cmd/go doesn't have any other default. |
Setting
But updating the comment in |
See #202030 and golang/go#70949. In particular, our current `go.env` contains # Automatically download newer toolchains as directed by go.mod files. # See https://go.dev/doc/toolchain for details. GOTOOLCHAIN=local The comment about automatically downloading newer toolchains applies only whenever `GOTOOLCHAIN=auto`, but we change that to `GOTOOLCHAIN=local`. Therefore, let's get rid of the comment that no longer applies after our `GOTOOLCHAIN` change.
See Homebrew#202030 and golang/go#70949. In particular, our current `go.env` contains # Automatically download newer toolchains as directed by go.mod files. # See https://go.dev/doc/toolchain for details. GOTOOLCHAIN=local The comment about automatically downloading newer toolchains applies only whenever `GOTOOLCHAIN=auto`, but we change that to `GOTOOLCHAIN=local`. Therefore, let's get rid of the comment that no longer applies after our `GOTOOLCHAIN` change.
I wonder if cmd/go should add a hint to go.mod parsing errors when the I'm thinking something like:
|
Actually, come to think of it, even with GOTOOLCHAIN=local, due to forward compatibility, Go 1.23 would refuse to build this module even if go.mod did parse. So perhaps the real improvement here is just to move the version-based refusal earlier. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Follow-up to https://groups.google.com/g/golang-nuts/c/DknrmQ9hi60/m/rfgpCOXcAQAJ
Trying to
go run
evcc-io/evcc#17656 which contains a go.mod withrunning
What did you expect to see?
Go 1.24rc1 downloaded and used
What did you see instead?
/cc @prattmic
The text was updated successfully, but these errors were encountered: