Dipen
Dipen

Reputation: 546

$GOPATH value keeps reseting to empty during new sessions of the terminal

I have installed GO on my Mac Book using the 10.8+ installer from golang.org, and I have set up a workspace. After running both these commands: export GOPATH=$HOME/go and export PATH=$PATH:$GOPATH/bin, echoing the GOPATH does return a value of /Users/dipen/go; however, after restarting the terminal, the echoing the GOPATH returns nothing. How can I fix this?

Upvotes: 1

Views: 2238

Answers (1)

jgritty
jgritty

Reputation: 11935

Add these lines to your ~/.bashrc or ~/.bash_profile:

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

Upvotes: 2

Related Questions