brew install go
worked well, as expected. However, at the end of the installation, the notes suggest I add GOROOT
to my path:
You may wish to add the GOROOT-based install location to your PATH:
export PATH=$PATH:/usr/local/opt/go/libexec/bin
Buuuuut, it didn’t work. After trying out some different iterations, I was reminded when ls
-ing through the surrounding directories that /usr/local/opt/go/...
was aliased because Homebrew. This Stack Overflow answer reinforced my hunch. So, I updated my .zshrc
:
export GOPATH="/Users/IceKing/Code/go" export GOROOT="/usr/local/Cellar/go/1.7.1/libexec" export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.npm-packages/bin:$GOROOT"
and it worked.
Background: homebrew, the missing package manager for osx | oh my zsh shell | golang