首先设置环境变量
cat /etc/profile
export GOROOT=/usr/local/go #go安装路径
export GOPATH=$HOME/go #go项目目录
export GOPROXY=https://goproxy.cn
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
设置shell代理
cat ~/.bashrc
export HTTP_PROXY=http://10.1.8.158:7890
export HTTPS_PROXY=http://10.1.8.158:7890
export no_proxy="localhost,127.0.0.1,.example.com"
cd /usr/local/go
wget https://golang.google.cn/dl/go1.23.5.linux-amd64.tar.gz
cd /usr/locall/go/src
go install github.com/beego/bee/v2@latest
cd /root/go/src
bee new hello
go get hello
bee run