訪問下載地址:https://golang.org/dl/
linux
32位系統下載go1.8.1.linux-386.tar.gz,64位系統下載go1.8.1.linux-amd64.tar.gz,golang
假定你想要安裝Go的目錄爲 $GO_INSTALL_DIR,後面替換爲相應的目錄路徑。bash
解壓縮tar.gz包到安裝目錄下:tar zxvf go1.8.1.linux-amd64.tar.gz -C $GO_INSTALL_DIRapp
而後在~/.bashrc
中作下面的設置:spa
export GOROOT=/home/s/apps/common/go export GOPATH=/home/s/apps/workspace/Go export PATH=$PATH:$GOPATH/bin:$GOROOT/bin
而後創建下面的路徑文件夾:code
/home/s/apps/workspace/Go/src /home/s/apps/workspace/Go/pkg /home/s/apps/workspace/Go/bin