[版权声明] 本站内容采用 知识共享署名-非商业性使用-相同方式共享 3.0 中国大陆 (CC BY-NC-SA 3.0 CN) 进行许可。
部分内容和资源来自网络,纯学习研究使用。如有侵犯您的权益,请及时联系我,我将尽快处理。
如转载请注明来自: Broly的博客,本文链接: unable to deduce repository and source type for "golang.org/x/sys/unix"
最近正式入坑Golang,采坑中
碰到的新坑:
用官方的依赖管理工具dep安装某个依赖,
1 |
dep ensure -v -add github.com/gin-gonic/gin |
结果提示这个
1 2 3 |
v0.0.1: unable to deduce repository and source type for "golang.org/x/sys/unix": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http:/ /golang.org/x/sys/unix?go-get=1": Get http://golang.org/x/sys/unix?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. |
好吧,看起来是网络问题居多。网上查了下资料,确实是网络问题,国内的网你懂的。
解决方法是前提你有梯子,然后在命令行下设置代理就可以。
Windows:
1 2 |
set http_proxy=127.0.0.1:1080 set https_proxy=127.0.0.1:1080 |
Linux:
1 2 |
export http_proxy=127.0.0.1:1080 export https_proxy=127.0.0.1:1080 |
再次执行就可以了