wget https://dl.google.com/go/go1.18.3.linux-amd64.tar.gz
tar -zvxf go1.18.3.linux-amd64.tar.gz
mv ./go /usr/local
sudo vim /etc/profile
写入
export GOROOT=/usr/local/go
export GOPATH=/usr/share/nginx/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
source /etc/profile
go version 完成