Go语言GOPROXY设置

发布时间 2023-08-28 17:00:43作者: PHP123net

1.首先开启go module

go env -w GO111MODULE=on     // Windows  export GO111MODULE=on        // macOS 或 Linux

2.

1-七牛云配置:
go env -w GOPROXY=https://goproxy.cn      // Windows  
export GOPROXY=https://goproxy.cn         // macOS 或 Linux

2-阿里云配置:
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/       // Windows  
export GOPROXY=https://mirrors.aliyun.com/goproxy/          // macOS 或 Linux


3.设置进行查看
go env设置是否生效


参考地址: https://blog.51cto.com/u_14097531/4955395