Golang推荐使用go mod管理依赖,而默认GoPROXY配置是:
GOPROXY=https://proxy.golang.org,direct
国内访问不到,所以推荐使用https://goproxy.io
或https://goproxy.cn
,配置如下:
go env -w GOPROXY=https://goproxy.cn,direct
这样,即可。
Golang推荐使用go mod管理依赖,而默认GoPROXY配置是:
GOPROXY=https://proxy.golang.org,direct
国内访问不到,所以推荐使用https://goproxy.io
或https://goproxy.cn
,配置如下:
go env -w GOPROXY=https://goproxy.cn,direct
这样,即可。