1.下载golang安装包去https://studygolang.com/dl最新的安装包wget https://go.dev/dl/go1.26.3.linux-amd64.tar.gz2.解压至/usr/local文件夹tar -C /usr/local -xzf go1.26.3.linux-amd64.tar.gz2.配置环境变量vim /etc/profileexport GOROOT=/usr/local/go #设置为go安装的路径export GOPATH=$HOME/go #默认安装包的路径export PATH=$PATH:$GOROOT/bin:$GOPATH/binsource /etc/profile使修改生效.go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.cn,direct