为了账号安全,请及时绑定邮箱和手机立即绑定

为什么“go get gopkg.in/...”不起作用而

为什么“go get gopkg.in/...”不起作用而

Go
冉冉说 2021-10-18 10:08:33
我尝试使用go get gopkg.in/fatih/pool.v2安装池根据Readme.md,但不能成功:C:\Users\xiaona\Documents\GitHub> go get -v gopkg.in/fatih/pool.v2Fetching https://gopkg.in/fatih/pool.v2?go-get=1https fetch failed.Fetching http://gopkg.in/fatih/pool.v2?go-get=1import "gopkg.in/fatih/pool.v2": http/https fetch: Get http://gopkg.in/fatih/pool.v2?go-get=1: dial tcp 107.178.216.236:80: ConnectEx tcp: A connection attemptfailed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.package gopkg.in/fatih/pool.v2: unrecognized import path "gopkg.in/fatih/pool.v2"107.178.216.236:80在网络浏览器中访问是可以的。我尝试使用go get github.com/fatih/pool,它也可以正常工作。任何人都可以就这个问题提供一些线索吗?顺便说一句:我使用windows powershell和git版本是1.9.5.
查看完整描述

1 回答

?
阿波罗的战车

TA贡献1862条经验 获得超6个赞

已经找到根本原因:因为我的电脑使用的是web代理,所以需要在环境变量中设置proxy:


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

然后,一切正常!


查看完整回答
反对 回复 2021-10-18
  • 1 回答
  • 0 关注
  • 267 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信