If you set a variable like this:
GOPATH=$HOME/go
It won't be exported to any subprocesses. It's only available to that process. If you want to export it to subprocesses, use export
:
export GOPATH
You can also combine the assignment and export:
export GOPATH=$HOME/go