操作
go get -v github.com/golang/net
现象
go get github.com/golang/net: module github.com/golang/net:
Get https://proxy.golang.org/github.com/golang/net/@v/list:
dial tcp 216.58.220.209:443: connectex:
A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond.
原因
所下载的库依赖有官方库,而官方被封禁网导致。
方法
法一:设置代理
go env -w GOPROXY=https://goproxy.cn
##设置完后 重新执行即可go get
ps:
go1.11发布后,还发布一个goproxy提供代理服务,goproxy.cn是专门服务于中国的,依赖于七牛云
github地址: https://github.com/goproxy
法二:git clone 依赖包直接到GOPATH/src/下
cd /d %GOPATH%/src/
git clone https://github.com/golang/net.git
ps:https://github.com/golang上为golang.org的镜像依赖包
所以,可以直接使用git clone代替go get