-
Notifications
You must be signed in to change notification settings - Fork 646
gopls does not honor go.alternateTools.go #3163
Comments
A work-around: "gopls": {
"env": {
"PATH": "$HOME/go/bin/go:$PATH",
}
} We're still working on unifying the configuration between VS Code Go and As an additional consideration, this is more a question for @ramya-rao-a: Is this the recommended approach for specifying a /cc @hyangah |
I have a pending pr #3159 If alternateTools is specified for go, I think that will be picked up instead of the goroot in most cases - Line 38 in 082bcfd
go.goroot and the alternateTools.go are both set and don't match.
|
It might be worth deprecating |
The nice thing about |
What d93a0ae did while fixing #2514 is to update the PATH env variable in the current running process to include path to the go binary. This ensured that any of the Go tools looking for the Go binary in the PATH would find it. Is
The value set for the Am no longer sure what the recommendation here should be. |
@ramya-rao-a If
This is done by Personally, I like Intellij's approach of treating go SDK path specially and I believe
|
@FiloSottile If you are using the Nightly version, this should be fixed now. Let us know if it's still an issue. |
This comment has been minimized.
This comment has been minimized.
Switched to Nightly, dropped the workaround, and it seems to work! |
Closing since the fix is in the nightly and the extension is being migrated: #3247. |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders0ba0ca52957102ca3527cf479571617f0de6ed50
x64
go env GOOS GOARCH
to get the operating system and processor architecture detailsamd64
Share the Go related settings you have added/edited
Describe the bug
gopls uses the go tool in $PATH rather than the one in go.alternateTools.go.
For a custom go tool to be picked up by go/packages its directory needs to be added to $PATH. This was fixed for most tools in #2514, but it looks like gopls does not pick up the same custom env.
An inconsistent go tool between gopls and other tools is almost certainly not intended behavior.
The text was updated successfully, but these errors were encountered: