Linux(CentOS7)源码安装Golang环境
1.官网【https://studygolang.com/dl】下载Golang安装包
[root@lw ~]# wget https://studygolang.com/dl/golang/go1.14.7.linux-amd64.tar.gz
2.解压安装包
[root@lw ~]# tar xf go1.14.7.linux-amd64.tar.gz -C /usr/local
3.配置环境变量
[root@lw ~]# vim /etc/profile
export GOROOT=/usr/local/go
export GOPATH=/home/goweb/goProject
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:$GOPATH/bin
4.验证
[root@lw ~]# go version
go version go1.14.7 linux/amd64