https://golang.google.cn/dl/
https://golang.google.cn/dl/go1.17.8.windows-amd64.zip
https://golang.google.cn/dl/go1.17.8.linux-amd64.tar.gz
::配置环境变量
setx "path" "C:\go\bin;%path%" /M
go env -w GO111MODULE=auto
# 下载安装
tar -xzf go*.linux-amd64.tar.gz -C /usr/local/
# 配置环境变量
vi /etc/profile
export GO111MODULE=on
export GOROOT=/usr/local/go
export GOPATH=$HOME/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
source /etc/profile
# 添加代理
go env -w GOPROXY=https://goproxy.cn,direct
# 查看版本
go version
# 编译
go build demo.go
# 运行
./demo
