使用dep时遇到的unable to deduce repository and source type for "golang.org/x/crypto"的问题处理 - Go语言中文社区

使用dep时遇到的unable to deduce repository and source type for "golang.org/x/crypto"的问题处理


今天,打算用golang的echo(https://github.com/labstack/echo)框架做一个demo,在按照其安装手册安装echo框架时,使用dep命令,如下:

dep ensure -add github.com/labstack/echo@^3.1

但是,虽然的git已经设置了代理,但是依然报错,如下:

Solving failure: unable to deduce repository and source type for "golang.org/x/crypto": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http://golang.org/x/crypto?go-get=1": Get http://golang.org/x/crypto?go-get=1: dial tcp 216.239.37.1:80: 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.

后面,终于在 https://github.com/golang/dep/issues/1322 中找到原因,解决方法如下:

if you have a proxy client put your proxy on in you cmd: run set http_proxy=ip:port before use dep ensure.example(windows):

set http_proxy=127.0.0.1:1235

set https_proxy=127.0.0.1:1235

it can visit golang.org to fix this issus

按照这个方式,终于解决了这个问题

版权声明:本文来源简书,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://www.jianshu.com/p/c4d7c5fd3c18
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-01-09 22:15:44
  • 阅读 ( 1930 )
  • 分类:Go

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢