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

x/tools/gopls: improve error message when user needs newer go version #61673

Open
hyangah opened this issue Jul 31, 2023 · 1 comment
Open

x/tools/gopls: improve error message when user needs newer go version #61673

hyangah opened this issue Jul 31, 2023 · 1 comment
Labels
gopls/metadata Issues related to metadata loading in gopls gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Jul 31, 2023

go version

go 1.21rc3
gopls v0.13.0

How to reproduce the issue

-- go.mod --
module example.com

go 1.23

And start gopls from this directory.

Screenshot 2023-07-31 at 12 42 10 PM

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.

Screenshot 2023-07-31 at 12 45 43 PM

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jul 31, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jul 31, 2023
@findleyr
Copy link
Contributor

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.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.14.0 Jul 31, 2023
@adonovan adonovan added the gopls/metadata Issues related to metadata loading in gopls label Aug 31, 2023
@findleyr findleyr modified the milestones: gopls/v0.14.0, gopls/v0.15.0 Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/metadata Issues related to metadata loading in gopls gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants