Go Modules 代理仓库服务
go module 公共代理仓库,代理并缓存 go 模块,利用该代理来避免 DNS 污染导致的模块拉取缓慢或失败的问题,加速你的构建。
GOPROXY
使用 go1.11 以上版本并开启 go module 机制
goproxy.io
# Enable the go modules feature
export GO111MODULE=on
# Set the GOPROXY environment variable
export GOPROXY=https://goproxy.io,directAliyun
export GOPROXY=https://mirrors.aliyun.com/goproxy/,directgoproxy.cn
export GOPROXY=https://goproxy.cn,directgoproxy 镜像搭建
docker run -p 8080:8080 ghcr.io/goproxy/goproxy server --address :8080F&Q
配置 GoLand
unrecognized import path "golang.org/x/oauth2" (https fetch: Get https://golang.org/x/oauth2?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)参考:https://goproxy.io/ 设置 goproxy。
GoLand —> Perferences —> Go —> Go Modules(vgo) —> Proxy;
注意:
- go 1.13 之后的版本配置有所不同
最近更新
最新评论