Within your .profile
export PATH=$PATH:/usr/local/go/bin # add go binaries to PATH
export GOPATH=~/Workspace/go # set root of all your go projects
export GOBIN=$GOPATH/bin # add binaries compiled from your projects
export PATH=$PATH:$GOBIN # add your own binaries to PATH
$GOROOT
defaults to /usr/local/go
- if that's not the case (i.e. you installed go to some different location), set the $GOROOT
directory as well.