Golang推荐使用go mod管理依赖,而默认GoPROXY配置是:GOPROXY=https://proxy.golang.org,direct
,国内访问不到,所以推荐使用https://goproxy.io
或https://goproxy.cn
。
执行下面的命令修改GOPROXY:
win+r
cmd
go env -w GOPROXY=https://goproxy.cn,direct
Golang推荐使用go mod管理依赖,而默认GoPROXY配置是:GOPROXY=https://proxy.golang.org,direct
,国内访问不到,所以推荐使用https://goproxy.io
或https://goproxy.cn
。
执行下面的命令修改GOPROXY:
win+r
cmd
go env -w GOPROXY=https://goproxy.cn,direct