Go: Only use EmitInvalidToolchainVersion if installed toolchain is >=1.21 && <1.23#18499
Closed
Go: Only use EmitInvalidToolchainVersion if installed toolchain is >=1.21 && <1.23#18499
EmitInvalidToolchainVersion if installed toolchain is >=1.21 && <1.23#18499Conversation
…`>=1.21 && <1.23`
This is reasonable because the tests use a new enough toolchain
…alled version is `1.21`
3af408e to
d26f49f
Compare
Contributor
|
@mbg Should this be closed, now that Go: remove invalid toolchain version diagnostics has been merged? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #15979, we added a diagnostic that warns the user if they are using Go 1.21 or above, their
go.modfile(s) do not contain an explicittoolchaindirective, 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 certaingocommands (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.23version 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.