linux - How do I SET the GOPATH environment variable on Ubuntu? What file must I edit?
I am trying to do a go get:

New Way:
Check out this answer.
Note: Not for trying out a go application / binaries on your host machine using go install [repo url], in such cases you still have to use the old way.
Old Way:
Just add the following lines to ~/.bashrc and this will persist. However, you can use other paths you like as GOPATH instead of $HOME/go in my sample.
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

