其他分享
首页 > 其他分享> > Go 语言设置goproxy.io镜像源

Go 语言设置goproxy.io镜像源

作者:互联网

Go 语言设置goproxy.io镜像源

学习Go语言的时候,因为很多代码包都在Github里,拉去代码包都很龟速,这是就需要镜像存在了,我这里使用的是goproxy.io镜像源

Go 版本是 1.13 及以上

go env -w GO111MODULE=on
go env -w GOPROXY="https://goproxy.io,direct"

# Set environment variable allow bypassing the proxy for selected modules (optional)
go env -w GOPRIVATE="*.corp.example.com"

# Set environment variable allow bypassing the proxy for specified organizations (optional)
go env -w GOPRIVATE="example.com/org_name"

Go 版本是 1.12 及以下

Linux or macOS
echo "export GOPROXY=https://goproxy.io" >> ~/.profile && source ~/.profile
Windows
  1. 右键 我的电脑 -> 属性 -> 高级系统设置 -> 环境变量
  2. 在 “[你的用户名]的用户变量” 中点击 ”新建“ 按钮
  3. 在 “变量名” 输入框并新增 “GOPROXY”
  4. 在对应的 “变量值” 输入框中新增 “https://goproxy.io”
  5. 最后点击 “确定” 按钮保存设置

标签:env,goproxy,go,io,Go,镜像
来源: https://blog.csdn.net/qq_35170166/article/details/120265000