Description
Is your feature request related to a problem? Please describe.
I'm working on a VSCode extension to automate the setup of a project using Golang (https://chromium.googlesource.com/chromiumos/platform/tast/). The extension depends on the Go extension and uses the "go.gopath" command to get the gopath, check if it is properly setup, and otherwise updates the gopath setting.
We just want to get the gopath the Go extension is using programatically, but it has a visible side effect, which is confusing for the user.
FWIW, the project is not migrated to Go modules, and it will take some time for it to happen.
Describe the solution you'd like
Provide a way to get the gopath the extension uses without any user-visible side effect.
Describe alternatives you've considered
I've considered reading the GOPATH environment variable, but it can be different from what the extension is using.
Additional context
Here is the change I'm working on https://crrev.com/c/3990228