安装步骤
- 下载安装包: https://studygolang.com/dl
- 解压到/usr/local:
$ tar -C /usr/local/ -xzvf go1.10.2.linux-amd64.tar.gz
- 设置环境变量
$ vim /etc/profile export GOROOT=/usr/local/go export GOPATH=/home/zhangboo/goProject export GOBIN=$GOPATH/bin export PATH=$PATH:$GOROOT/bin export PATH=$PATH:$GOPATH/bin
- 使环境变量生效
$ source /etc/profile
参考
https://www.jianshu.com/p/8f0646e3858c