This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Place the go runtime base path to the front of PATH #3159
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Users can specify the go command to use by setting GOROOT env var,
go.goroot
vscode setting, or PATH env var. getBinPath('go') isused to choose the right version of 'go' whenever the extension
tries to invoke the go commands. However, this does not affect
other tools that invoke the go command underneath.
For example, delve, gopls, and many tools simply pick a version of
go from PATH. If the GOROOT env var and the version of go found in
the PATH don't match, this can lead to errors.
This CL places the go runtime base bin path as the first element of
the PATH env var. That ensures any tools invoked by the extension
to pick the same version of go, as long as they stick with the usual
PATH-based executable search.
Note this process.env mutation does not affect the environment variable
settings the integrated terminal would see, but this is not a new
problem.
Fixes #3152