Don't suggest adding GOROOT/bin and GOPATH/bin to the PATH.#463
Merged
Conversation
The installation instructions say to make the shell init script execute the
output of `goenv init -`. That output contains this among other things:
```
export PATH="${GOENV_ROOT}/shims:${PATH}"
```
The main point of that line is to make the `go` command resolve to
`$GOENV_ROOT/shims/go` such that `goenv` has control over the default `go`.
The installation instructions later say to add this after the eval in order to
let "goenv manage GOPATH and GOROOT":
```
export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
```
This effectively overrides the first line as `$GOROOT/bin` is also expected to
contain a `go` binary. However that binary is not controlled by `goenv`.
Furthermore AFAICT these two lines do not make "goenv manage GOPATH and GOROOT".
This has confused at least [one other user](go-nv#186 (comment)).
This change removes the section about GOROOT and GOPATH as I don't see why it
would belong in the goenv installation instructions.
ChronosMasterOfAllTime
approved these changes
Jul 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The installation instructions say to make the shell init script execute the output of
goenv init -. That output contains this among other things:The main point of that line is to make the
gocommand resolve to$GOENV_ROOT/shims/gosuch thatgoenvhas control over the defaultgo.The installation instructions later say to add this after the eval in order to let "goenv manage GOPATH and GOROOT":
This effectively overrides the first line as
$GOROOT/binis also expected to contain agobinary. However that binary is not controlled bygoenv. Furthermore AFAICT these two lines do not make "goenv manage GOPATH and GOROOT".This has confused at least one other user.
This change removes the section about GOROOT and GOPATH as I don't see why it would belong in the goenv installation instructions.
Fixes #462.