转载链接:https://www.jianshu.com/p/5e8607963bb5
GOPROXY
国内镜像加速地址:
-
七牛 CDN
go env -w GOPROXY=https://goproxy.cn,direct -
阿里云
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct -
官方
go env -w GOPROXY=https://goproxy.io,direct
Windows 下设置 GOPROXY 的命令为:
go env -w GOPROXY={{地址}}
MacOS 或 Linux 下设置 GOPROXY 的命令为:
export GOPROXY={{地址}}
Go语言在 1.13 版本之后 GOPROXY 默认值为 https://proxy.golang.org,在国内可能会存在下载慢或者无法访问的情况,所以十分建议大家将 GOPROXY 设置为国内的 goproxy.cn。