使用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

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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,107评论 19 139
  • 小时候大人总会和我们说要听话守规矩 可长大了又有多少人在守规矩 坐在大伯的小电驴后面每次看他超越红灯就超级害怕 开...
    nicole_e阅读 1,279评论 0 0
  • Dawn —— via. win
    三一月阅读 1,783评论 0 0
  • 不知道是不是因为年关将近,谈恋爱的人最近都开始谈钱。 先是有人拿着2500元的衣服试女友,要是女友舍不得买,就说明...
    我是销冠阅读 1,787评论 0 0
  • 今天不废话 单挑 856 防 536
    品味舍得_8866阅读 1,832评论 0 0

友情链接更多精彩内容