Centos下使用epel源安装:
| 1 | yum installgolang | 
Centos/Linux下源码安装golang:
| 1 2 3 4 5 6 7 | wget https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gztar-C /usr/local-xzf go1.4.1.linux-amd64.tar.gzmkdir$HOME/goecho‘export GOROOT=/usr/local/go‘>> ~/.bashrc echo‘export GOPATH=$HOME/go‘>> ~/.bashrc echo‘export PATH=$PATH:$GOROOT/bin:$GOPATH/bin‘>> ~/.bashrc source$HOME/.bashrc  | 
安装go get工具:
| 1 | yum installmercurial git bzr subversion | 
Windows下安装:
| 1 | https://storage.googleapis.com/golang/go1.4.1.windows-386.zip | 
设置环境变量:
| 1 2 3 4 5 | setx GOOS windowssetx GOARCH 386setx GOROOT "D:\Program Files\go"setx GOBIN "%GOROOT%\bin"setx PATH%PATH%;D:\Program Files\go\bin" | 
 
        