1、wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
2、sudo tar -C /usr/local -xzf go1.10.2.linux-amd64.tar.gz
4、vim ~/.bashrc
添加以下内容:
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go
export GOPATH=$HOME/go(go文件夹先创建好 mkdir go)
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
5、source ~/.bashrc
6、go version