-
Notifications
You must be signed in to change notification settings - Fork 164
Installing Go
Download and run the installer found at http://golang.org/doc/install
For simplicity down the line, it is recommended to install Go via brew rather than installing via http://golang.org/doc/install
Install brew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install Go:
brew update brew install go
You need a go directory to place your Go apps, so create it. You can call it whatever your want, most people choose to call it 'Go'
mkdir ~/go;
Now set the GOPATH to the directory you just created. GOPATH is where Go will look for your Go apps
export GOPATH=$HOME/go
This will only work for the duration of your session, so save it to your bash profile
echo GOPATH=$GOPATH >> ~/.bash_profile
Download the latest distribution
curl -O https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz
Unpack it to the /usr/local
(might require sudo)
tar -C /usr/local -xzf go1.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
mkdir ~/go; export GOPATH=$HOME/go
❤️ Stay Classy