- You'll want 1.4.x
- Don't get it from the package manager (unless you use Arch, brew is also fine)
Set GOROOT
to where Go is installed, GOPATH
to where you'll want
libraries to be installed and where you'll be working
- ~/go is a good GOROOT
- ~/src is a good GOPATH
You would be working on ~/src/github.com/you/project
Imports are always relative to your GOPATH.
import "github.com/you/project" // is valid
import "../project" // is not valid
Get other packages here: https://golang.org/dl/
cd ~
wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
tar -xzvf go1.4.2.linux-amd64.tar.gz # creates the ~/go folder
mkdir ~/src
No add this to ~/.bashrc:
export GOROOT="~/go"
export GOPATH="~/src"
export PATH="$PATH:$GOROOT/bin"
GoSublime and vim-go
For GoSublime, Ctrl+Shift+P, Install Package, GoSublime
For vim-go tips, look at: https://robots.thoughtbot.com/writing-go-in-vim
Clone Docker:
git clone [email protected]:docker/docker.git $GOPATH/github.com/docker/docker
cd $GOPATH/github.com/docker/docker
# Make contribution
# PULL REQUEST
# Make next contribution
# PULL REQUEST
...