1、官方源下载
wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
2、解压
tar zxvf go1.12.7.linux-amd64.tar.gz
3、将golang解压目录(e.g:/opt/go/bin),修改环境变量:
vim /root/.bash_profile
追加到PATH=$PATH:/opt/go/bin
4、编译生效
source /root/.bash_profile
5、查看golang版本
go version
6、安装gopm
go get -v -u github.com/gpmgo/gopm
7、修改环境变量
vim /root/.bash_profile
export GOPATH="/opt/gopath:/opt/proj/
8、编译生效
source /root/.bash_profile
PS:安装项目下所有依赖:
go get -v ./...