centos bash脚本一键运行安装go环境
复制到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.gzmkdir /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 ~/.bashrcmkdir -p /code/gomkdir /code/go/src
mkdir /code/go/pkg
mkdir /code/go/bin