centos 安装 go
下载
[root@localhost download]# wget https://golang.google.cn/dl/go1.17.4.linux-amd64.tar.gz
# 解压
[root@localhost download]# tar xvf go1.17.4.linux-amd64.tar.gz
# 移到到 /usr/locla
[root@localhost download]# mv go /usr/local/
设置代理
~/.bashrc
# 设置 GOROOT(go 安装路径)
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
# 设置代理
export GOPROXY="https://goproxy.cn,direct"
export GO111MODULE="auto"
验证
go version