This installation guide is based on Ubuntu 14.04+ on x86-64 platform.
$ sudo apt-get install git build-essential
Download Go 1.5+ from https://golang.org/dl/.
$ wget https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz
$ mkdir -p ${HOME}/bin/
$ mkdir -p ${HOME}/go/
$ tar -C ${HOME}/bin/ -xzf go1.5.1.linux-amd64.tar.gz
Add the following exports to your ~/.bashrc
. Environment variable GOROOT specifies the location of your golang binaries
and GOPATH specifies the location of your project workspace.
export GOROOT=${HOME}/bin/go
export GOPATH=${HOME}/go
export PATH=$PATH:${HOME}/bin/go/bin:${GOPATH}/bin
$ source ~/.bashrc
$ go env
This installation document assumes OS X Yosemite 10.10+ on x86-64 platform.
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install git python
Install golang binaries using brew
$ brew install go
$ mkdir -p $HOME/go
Add the following exports to your ~/.bash_profile
. Environment variable GOROOT specifies the location of your golang binaries
and GOPATH specifies the location of your project workspace.
export GOPATH=${HOME}/go
export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6)
export GOROOT=$(brew --prefix)/Cellar/go/${GOVERSION}/libexec
export PATH=$PATH:${GOPATH}/bin
$ source ~/.bash_profile
$ go env