今天,打算用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
按照这个方式,终于解决了这个问题