代理
更新于 2023-02-17
Go默认不会直接从GitHub拉源码
而是通过Go Proxy(模块代理):https://proxy.golang.org
该代理缓存了GitHub上的所有版本
版本会缓存在$GOPATH/pkg/mod
shell
#设置代理
go env -w GOPROXY=https://goproxy.cn,direct
#绕过代理
export GOPROXY=directhttps代理
shell
# POWERSHELL
$env:HTTPS_PROXY="http://127.0.0.1:10809"
# CMD
set https_proxy=http://127.0.0.1:10809
# LINUX
export https_proxy=http://127.0.0.1:10809go国内代理
shell