Go公共代理镜像:
官方:https://goproxy.io/
七牛:https://goproxy.cn
阿里:https://mirrors.aliyun.com/goproxy/
Windows命令终端临时设置
1
2
|
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
|
Windows设置环境变量
1
2
3
|
$env:GO111MODULE= "on"
$env:GOPROXY = "https://goproxy.cn,direct"
$env:GOPRIVATE = "git.mycompany.com,github.com/my/private"
|
Linux设置环境变量
1
2
3
4
|
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
# 设置不走 proxy 的私有仓库或组,多个用逗号相隔(可选)
export GOPRIVATE=git.mycompany.com,github.com/my/private
|