拉取golang.org/x/crypto包失败

问题:go项目在run或者build的时候,会报如下的错:

golang.org/x/[email protected]: 
Get "https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190325154230-a5d413f7728c.mod": 
dial tcp 216.58.200.49: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.

解决

进入GOPATH的目录/src/golang.org/x/下,如果不存在,则手动创建,然后手动下载如下的包:

mkdir -p $GOPATH/src/golang.org/x/
cd !$
git clone https://github.com/golang/net.git
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/tools.git
git clone https://github.com/golang/crypto.git
发布了19 篇原创文章 · 获赞 1 · 访问量 9994

猜你喜欢

转载自blog.csdn.net/doStruggle/article/details/105281352
今日推荐