douhu2370 2015-06-15 03:21
浏览 193
已采纳

为什么“去获取github.com/…”行得通,为什么“去获取gopkg.in/…”行不行?

I try to use go get gopkg.in/fatih/pool.v2 to install pool according to Readme.md, but can't success:

C:\Users\xiaona\Documents\GitHub> go get -v gopkg.in/fatih/pool.v2
Fetching https://gopkg.in/fatih/pool.v2?go-get=1
https fetch failed.
Fetching http://gopkg.in/fatih/pool.v2?go-get=1
import "gopkg.in/fatih/pool.v2": http/https fetch: Get http://gopkg.in/fatih/poo
l.v2?go-get=1: dial tcp 107.178.216.236:80: ConnectEx tcp: A connection attempt
failed because the connected party did not properly respond after a period of ti
me, or established connection failed because connected host has failed to respon
d.
package gopkg.in/fatih/pool.v2: unrecognized import path "gopkg.in/fatih/pool.v2
"

While access 107.178.216.236:80 is OK in web browser.

I try to use go get github.com/fatih/pool, and it also works OK.

Could anyone give some clues on this issue?

BTW: I use windows powershell and git version is 1.9.5.

  • 写回答

1条回答 默认 最新

  • dousong5492 2015-06-17 06:12
    关注

    The root cause has been found: Because my computer use a web proxy, so I need to set proxy in environment variable:

    C:\Users\xiaona>set https_proxy=https://web-proxy.corp.hp.com:8080/
    
    C:\Users\xiaona>set http_proxy=https://web-proxy.corp.hp.com:8080/
    
    C:\Users\xiaona>go get -v gopkg.in/fatih/pool.v2
    Fetching https://gopkg.in/fatih/pool.v2?go-get=1
    Parsing meta tags from https://gopkg.in/fatih/pool.v2?go-get=1 (status code 200)
    
    get "gopkg.in/fatih/pool.v2": found meta tag main.metaImport{Prefix:"gopkg.in/fa
    tih/pool.v2", VCS:"git", RepoRoot:"https://gopkg.in/fatih/pool.v2"} at https://g
    opkg.in/fatih/pool.v2?go-get=1
    gopkg.in/fatih/pool.v2 (download)
    gopkg.in/fatih/pool.v2
    

    Then, all is OK!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况