-
Notifications
You must be signed in to change notification settings - Fork 769
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
tools: warn users if go.goroot is configured - it mutates GOROOT env var #1501
Comments
Thanks for the report @TheJonRobinson |
I also started seeing this issue with the update to v0.25.0 of the Go extension. I checked my VS Code settings and there was a |
Ah - so yes, our project does have a workspace, which does indeed set `go.goroot` - I missed that because I just used the Preferences: Open Settings (JSON) which doesn’t include those.
Removing the setting altogether resolves the problem though, as I just noticed @bestbeforetoday commented. Similarly, that setting has been there since I created the project, and I can’t remember whether it was automagically set or I did but it certainly was benign before 0.25.0
|
Long story - For many years Unfortunately, there are still some popular version management tools that were written long ago and somehow depends on setting Most users shouldn't set We can add extra warnings when |
Just for the sake of thoroughness for any googlers landing here, make sure to also check WSL settings if using VS Code Remote to program in WSL. In my case, that's where the stale go.root setting was located. |
Change https://golang.org/cl/320429 mentions this issue: |
Change https://golang.org/cl/320549 mentions this issue: |
Warn users if this is an obviously invalid value (binary). Show information popup if go.goroot is configured. And, fixes a bug in v0.25.0 - missing await when checking whether the go.goroot value is a valid directory. Fixes #1501 Change-Id: I3487f4b089c9ba4fe34f36e5e033ae19d63537e2 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/320429 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> (cherry picked from commit 9fa871b) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/320549
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
We have been happily using 0.24.2 on the extension, but after the update happened to 0.25.0, we get the following pop-up when opening the VS-Code project:
Also, in the OUTPUT window:
After this, gopls is not present/working and the go environment seems somewhat broken.
NB If we revert the extension back to the previous one, the problems go away.
We'd expect the behaviour to remain as before the 0.25.0 update.
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: