Thursday, June 2, 2016

Set GOPATH on mac OS X

Go 1.2 and beyond requires go path to be set for go get command to work.

If you are using iterm then in your .zshrc file go ahead and paste the following

export PATH=$PATH:/usr/local/opt/go/libexec/bin
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin

You should be up and running.

No comments:

Post a Comment