复制到install_go.sh直接bash install_go.sh运行就完了
echo '----------安装go环境'
wget https://go.dev/dl/go1.21.13.linux-amd64.tar.gz
tar -zxvf go1.21.13.linux-amd64.tar.gz
mkdir /srv
cp -r go /srv/
echo "PATH=$PATH:/srv/go/bin ">> ~/.bashrc
echo 'export GOPATH=/code/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
echo "export PATH ">> ~/.bashrc
source ~/.bashrc
mkdir -p /code/go
mkdir /code/go/src
mkdir /code/go/pkg
mkdir /code/go/bin