go语言环境变量配置
- arm64自动化配置脚本
cd /opt/softs/;
tar -zxvf go1.18.1.linux-arm64.tar.gz -C /opt/ ;
echo "export GOROOT=/opt/go" >> /etc/profile ;
echo "export PATH=$PATH:/opt/go/bin" >> /etc/profile ;
echo "export GOPATH=/opt/gopath" >> /etc/profile ;
echo "export GO111MODULE=on" >> /etc/profile ;
echo "export GOPROXY=https://goproxy.cn" >> /etc/profile ;
source /etc/profile;
mkdir -p /opt/gopath ;
mkdir -p /opt/gopath/src;
mkdir -p /opt/gopath/bin;
mkdir -p /opt/gopath/pkg;
mkdir -p /opt/gopath/src/github.com;
go env ;
go version;
ls ;
- 64位自动化配置脚本
cd /opt/softs/;
tar -zxvf go1.18.2.linux-amd64.tar.gz -C /opt/ ;
echo "export GOROOT=/opt/go" >> /etc/profile ;
echo "export PATH=$PATH:/opt/go/bin" >> /etc/profile ;
echo "export GOPATH=/opt/gopath" >> /etc/profile ;
echo "export GO111MODULE=on" >> /etc/profile ;
echo "export GOPROXY=https://goproxy.cn" >> /etc/profile ;
source /etc/profile;
mkdir -p /opt/gopath ;
mkdir -p /opt/gopath/src;
mkdir -p /opt/gopath/bin;
mkdir -p /opt/gopath/pkg;
mkdir -p /opt/gopath/src/github.com;
go env ;
go version;
ls ;