HOW TO : Set $GOPATH

Been dabbling in go recently and I was surprised that the default install doesn’t setup the $GOPATH environment variable.

If you are running it on a Linux box, here is how your can set the $GOPATH variable

Add the following lines to ~/.bashrc file 

export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.