1.下载安装包
yum install wget -y
wget https://golang.google.cn/dl/go1.15.6.linux-amd64.tar.gz
2.解压
tar zxf go1.15.6.linux-amd64.tar.gz -C /usr/local/
3.添加环境变量
vim /etc/profile
vim /etc/bashrc
最后一行添加:
export PATH=$PATH:/usr/local/go/bin
4.使环境变量生效
source /etc/profile
source /etc/bashrc
5.ok啦~
go version
go version go1.15.6 linux/amd64