Skip to content

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

Closed
mbg wants to merge 5 commits intomainfrom
mbg/go/old-version-format-is-ok-again
Closed

Go: Only use EmitInvalidToolchainVersion if installed toolchain is >=1.21 && <1.23#18499
mbg wants to merge 5 commits intomainfrom
mbg/go/old-version-format-is-ok-again

Conversation

@mbg
Copy link
Copy Markdown
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
@mbg mbg force-pushed the mbg/go/old-version-format-is-ok-again branch from 3af408e to d26f49f Compare February 19, 2025 13:47
@owen-mc
Copy link
Copy Markdown
Contributor

owen-mc commented May 30, 2025

@mbg Should this be closed, now that Go: remove invalid toolchain version diagnostics has been merged?

@mbg mbg closed this May 30, 2025
@mbg mbg deleted the mbg/go/old-version-format-is-ok-again branch May 30, 2025 10:37
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.

2 participants