-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
x/tools/gopls: improve error message when user needs newer go version #61673
Comments
I think we should no longer use a temp mod file in this case, since the go command should no longer mutate the mod file. |
Change https://go.dev/cl/576678 mentions this issue: |
The type checker produces an error if the Go version is too new. When compiled with Go 1.21, this error is silently dropped on the floor and the type checked package is empty, due to golang/go##66525. Guard against this very problematic failure mode by filtering out Go versions that are too new. We should also produce a diagnostic, but that is more complicated and covered by golang/go#61673. Also: fix a bug where sandbox cleanup would fail due to being run with a non-local toolchain. Fixes golang/go#66677 Change-Id: Ia66f17c195382c9c55cf0ef883e898553ce950e3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/576678 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change https://go.dev/cl/577302 mentions this issue: |
…sions for type checking NOTE: Patched for the release branch to use versions.Compare rather than versions.Before. The type checker produces an error if the Go version is too new. When compiled with Go 1.21, this error is silently dropped on the floor and the type checked package is empty, due to golang/go##66525. Guard against this very problematic failure mode by filtering out Go versions that are too new. We should also produce a diagnostic, but that is more complicated and covered by golang/go#61673. Also: fix a bug where sandbox cleanup would fail due to being run with a non-local toolchain. Updates golang/go#66677 Updates golang/go#66730 Change-Id: Ia66f17c195382c9c55cf0ef883e898553ce950e3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/576678 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit de6db98) Reviewed-on: https://go-review.googlesource.com/c/tools/+/577302
As of https://go.dev/cl/579439 we no longer use a temp mod file for loads, so this error message should be improved. |
go version
go 1.21rc3
gopls v0.13.0
How to reproduce the issue
And start gopls from this directory.
go1.23 is not available so this error is expected. (Users who have
GOTOOLCHAIN=local
env would experience similar issues). But the error message that references a temporary go.mod file can be potentially confusing for users. Either rewrite the error message or at least, replace the temporary go.mod file with the original go.mod file in the message.And this diagnostic is attached to the "module" line. But for this specific error, I think the "go" line may be more suitable if feasible.
The text was updated successfully, but these errors were encountered: