Skip to content

Commit

Permalink
move $GOPATH/bin to end of $PATH
Browse files Browse the repository at this point in the history
Closes go-nv#99.
  • Loading branch information
stevegt committed Oct 8, 2019
1 parent 256f7c8 commit b7872e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ easy to fork and contribute any changes back upstream.
add `GOPATH` and `GOROOT` to your shell **after `eval "$(goenv init -)"`**.

$ echo 'export PATH="$GOROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="$GOPATH/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bash_profile
**Zsh note**: Modify your `~/.zshenv` or `~/.zshrc` file instead of `~/.bash_profile`.
**Ubuntu note**: Modify your `~/.bashrc` file instead of `~/.bash_profile`.
Expand All @@ -48,6 +48,11 @@ easy to fork and contribute any changes back upstream.
`eval "$(goenv init -)` into `.bash_profile`, and **not** into `.bashrc`. Otherwise you
may observe strange behaviour, such as `goenv` getting into an infinite loop.
See pyenv's issue [#264](https://github.com/yyuu/pyenv/issues/264) for details.

**Security warning**: You likely want to keep $GOPATH/bin at the end
of your $PATH as shown above, rather than at the beginning. See
[#99](https://github.com/syndbg/goenv/issues/99) for details and
discussion.


5. **Restart your shell so the path changes take effect.**
Expand All @@ -69,7 +74,7 @@ export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
export PATH="$GOROOT/bin:$PATH"
export PATH="$GOPATH/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
```

## Homebrew on Mac OS X
Expand Down

0 comments on commit b7872e7

Please sign in to comment.