win10 goproxy

设置包管理代码

cmd

// 偶尔不灵光
go env -w GOPROXY=https://goproxy.cn,direct

// 最近使用
go env -w GOPROXY=https://proxy.golang.com.cn,direct
linux
# 配置 GOPROXY 环境变量
export GOPROXY=https://proxy.golang.com.cn,direct
# 还可以设置不走 proxy 的私有仓库或组,多个用逗号相隔(可选)
export GOPRIVATE=git.mycompany.com,github.com/my/private

powershell

# 配置 GOPROXY 环境变量
export GOPROXY=https://proxy.golang.com.cn,direct
# 还可以设置不走 proxy 的私有仓库或组,多个用逗号相隔(可选)
export GOPRIVATE=git.mycompany.com,github.com/my/private
posted @ 2022-06-28 17:09  vx_guanchaoguo0  阅读(363)  评论(0编辑  收藏  举报