1

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?

Dipen
  • 536
  • 2
  • 5
  • 13

1 Answers1

2

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

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
jgritty
  • 11,660
  • 3
  • 38
  • 60
  • Ok. I do same way oh my macbook. Also I have VPS running Ubuntu 14 which I access via SSH only for sure. Due to interactive non interactive shell distinction ~/.bashrc not always sourced. Which profile or rc guaranteed to be sourced on Ubuntu in all case? – Uvelichitel Jan 18 '15 at 11:03
  • That's probably worthy of a separate question, and might already have an answer here. – jgritty Jan 18 '15 at 11:15