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

Go: Only use EmitInvalidToolchainVersion if installed toolchain is >=1.21 && <1.23 #18499

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mbg
Copy link
Member

@mbg mbg commented Jan 15, 2025

In #15979, we added a diagnostic that warns the user if they are using Go 1.21 or above, their go.mod file(s) do not contain an explicit toolchain directive, and the Go language version does not match the toolchain format. This was a problem, because Go would use the language version as a fallback for the toolchain version and certain go commands (notably downloading newer compiler versions) would fail if a language version was used as a toolchain version.

However, the Go team have changed their minds about the behaviour if the language version does not match the toolchain version format.

This PR modifies the logic for emitting the diagnostic so that it is only emitted if the installed Go toolchain is in the >= 1.21 && < 1.23 version range.

I did some testing and it seems that even the "problematic" versions in that range now succeed at downloading newer compilers, so we may not need this diagnostic at all, but I opted for leaving it in with the new check since it is technically wrong if one of those versions of the Go toolchain are used.

@github-actions github-actions bot added the Go label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant