Open clowenhg opened 1 year ago
I have actually figured out what the problem was.
Simply removing: "go.gopath": "$HOME/go",
from my settings fixed the problem.
I'm hoping this helps others.
I don't know how this got set in the first place, so perhaps this is a bug in the installation. I'm inclined to leave this open as this may be a bug in the setup.
I have actually figured out what the problem was. Simply removing:
"go.gopath": "$HOME/go",
from my settings fixed the problem.
Thank you, you got me along the right lines. After the latest VSCode update, I guess my go.gopath under Remote/WSL2 settings was set to "" (empty string). I copied in the value I found by running "go env", saved, restarted VSCode, and it seems ok again now.
I have actually figured out what the problem was. Simply removing:
"go.gopath": "$HOME/go",
from my settings fixed the problem.I'm hoping this helps others.
I don't know how this got set in the first place, so perhaps this is a bug in the installation. I'm inclined to leave this open as this may be a bug in the setup.
Thanks for your help, saved me an hour of searching for such little problem
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
* Run `go version` to get version of Go from _the VS Code integrated terminal_. - go version go1.20 windows/amd64 - also experienced with go1.19 windows/amd64 * Run `gopls -v version` to get version of Gopls from _the VS Code integrated terminal_. Build info ---------- golang.org/x/tools/gopls 0.4.3 golang.org/x/tools/gopls@v0.4.3 h1:irz7Q+XdHNECamFKbNWKvMV2Ak6zBbwdwbZndG4545I= github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/tools@v0.0.0-20200708181441-6004c8539734 h1:Vc0Vx98oU/O3+qPQ36fnTT5UduS55KLh2uSGbL7mqEo= golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A= Go info ------- go version go1.20 windows/amd64 * Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders. 1.75.0 e2816fe719a4026ffa1ee0189dc89bdfdbafb164 x64 * Check your installed extensions to get the version of the VS Code Go extension - v0.37.1 * Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > `Go: Locate Configured Go Tools` command. - Command 'Go: Locate Configured Go Tools' resulted in an error (command 'go.locate.tools' not round)
Share the Go related settings you have added/edited
Describe the bug
The Go extension appears to fail initializing. I have no code completion, automatic vetting, linting or formatting.
In my Output for Go:
The locations are correct.
I think relevantly, my default terminal is PowerShell and the above command
'C:\Program Files\Go\bin\go.exe env'
would be invalid and should be prefixed with an &.& 'C:\Program Files\Go\bin\go.exe' env -json GOPATH GOROOT GOPROXY GOBIN GOMODCACHE Yields:
I'd expect the extension to behave as it does in other environments. It currently works exactly as I'd like inside of a WSL2 Ubuntu instance on the same machine.
Steps to reproduce the behavior:
Screenshots or recordings
N/A