g
g copied to clipboard
Support go env as fallback for setting GOPATH and GOROOT in env
Sorry, I opened a PR without reading the contributing guidelines.
I'm proposing to support using go env as fallback for explicitly setting GOPATH and GOROOT. Go will read those values from a config file, e.g. ~/.config/go/env`, and thus setting them in the environment is not required.
Hi @avorima I was reviewing your PR, but I need to understand the use-case first.
This would be to drop the g file somewhere in your path and have it rely on a previous golang installation?
If that's the case, I'm concerned it would require root rights, as most golang installations (from package managers, official golang guides, etc) use system paths like /usr/local. Also if a user follows the proposed "Manual Installation" guide and has go1.12 installed from their package manager, go env -w would fail confusing the user. Alongside to have to run g with sudo every time.
I generally advise against using g with previous golang installations, but g could support this use-case unofficially.
Closing because of lack of response. Feel free to re-open if still interested.