go get速度慢使用代理解决办法
阿里云 go 代理地址:https://mirrors.aliyun.com/goproxy/
go 全球地址:https://goproxy.io/zh/
这里针对版本不同,提供两个办法:
1.如果您使用的 Go 版本是 1.13 及以上 (推荐)
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
2.如果您使用的 Go 版本是 1.12 及以下
(1)-Bash (Linux or macOS)
启用 Go Modules 功能
export GO111MODULE=on
配置 GOPROXY 环境变量
export GOPROXY=https://goproxy.io
1
2
(2)-Windows PowerShell
启用 Go Modules 功能
$env:GO111MODULE=“on”
配置 GOPROXY 环境变量
$env:GOPROXY=“https://goproxy.io”