Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

go binary in $GOROOT should be prioritized #1760

Closed
FiloSottile opened this issue Jun 29, 2018 · 9 comments
Closed

go binary in $GOROOT should be prioritized #1760

FiloSottile opened this issue Jun 29, 2018 · 9 comments

Comments

@FiloSottile
Copy link
Contributor

Since e882fb2, the go binary in $PATH is prioritized even if go.goroot is explicitly set. It can be overridden with go.alternateTools, but it is pretty unexpected.

@FiloSottile
Copy link
Contributor Author

Also, go.alternateTools does not expand ~, so it doesn't fully work as a replacement.

@ramya-rao-a
Copy link
Contributor

Thanks for reporting @FiloSottile

Is it a common scenario to have different go binaries in $PATH vs the goroot?

@FiloSottile
Copy link
Contributor Author

Myself I use it to develop on the standard library, and I would expect most people doing that to have different binaries in PATH. I think it's closely correlated to setting GOROOT explicitly, as that often implies using a separate toolchain.

The priority I would expect it alternateTools > GOROOT > PATH.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jun 29, 2018

How about other Go tools like gofmt and 3rd party Go tools

alternateTools > GOPATH > PATH > GOROOT
or
alternateTools > GOPATH > GOROOT > PATH ?

@FiloSottile
Copy link
Contributor Author

No real reason for anything else than gofmt and go to be in GOROOT/bin, so it's almost irrelevant, but I guess "alternateTools > GOROOT > GOPATH > PATH" for consistency across all tools?

@ramya-rao-a
Copy link
Contributor

I have pushed the fix to master. Can you give it a try by following the below steps and share any feedback you have.

@FiloSottile
Copy link
Contributor Author

Thank you! ✨

@RinaFave01
Copy link

Cc creative commons

@ramya-rao-a
Copy link
Contributor

The fix for this issue is now out in the latest update (0.6.85) to the Go extension.

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants