if["$(uname-m)"="x86_64"];thenARCH="amd64"elseARCH="arm64"fiVERSION=1.22.5 # 或者填自己想安装的版本URL="http://mirror.nju.edu.cn/golang/go$VERSION.linux-$ARCH.tar.gz"# http://mirror.nju.edu.cn/golang/GOROOT=/opt/go$VERSIONsudomkdir-p"$GOROOT"wget"$URL"tar xf "$(basename"$URL")"-C"$GOROOT" --strip-components=1tee-a"$HOME/.profile"<<EOF
export GOROOT="$GOROOT"
export GOPATH="\$HOME/go"
export PATH=\$GOROOT/bin:\$GOPATH/bin:\$PATH
EOFsource"$HOME/.profile"
go version
go env-wGO111MODULE=on
go env-wGOPROXY="https://repo.nju.edu.cn/repository/go/,direct"
go env|grep-E"GO111MODULE|GOPROXY"