关于使用go get安装go-echo时的一些问题

caozhiheng0625 · 2017-07-23 14:54:09 · 2272 次点击 · 大约8小时之前 开始浏览    置顶
这是一个创建于 2017-07-23 14:54:09 的主题,其中的信息可能已经有所发展或是发生改变。

安装时显示下列问题请大神帮忙看一看 怎样解决

G:\GO\go\src\project>go get github.com/labstack/echo/...
# cd C:\Users\Administrator\go\src\github.com\labstack\gommon; git pull --ff-only
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.
package github.com/labstack/gommon/color: exit status 1
package github.com/labstack/gommon/log: cannot find package "github.com/labstack/gommon/log" in any of:
        G:\GO\go\src\github.com\labstack\gommon\log (from $GOROOT)
        C:\Users\Administrator\go\src\github.com\labstack\gommon\log (from $GOPATH)
package golang.org/x/crypto/acme/autocert: unrecognized import path "golang.org/x/crypto/acme/autocert" (https fetch: Get https://golang.org/x/crypto/acme/autocert?go-get=1: net/http: TLS handshake timeout)
package github.com/labstack/gommon/bytes: cannot find package "github.com/labstack/gommon/bytes" in any of:
        G:\GO\go\src\github.com\labstack\gommon\bytes (from $GOROOT)
        C:\Users\Administrator\go\src\github.com\labstack\gommon\bytes (from $GOPATH)
package github.com/labstack/gommon/random: cannot find package "github.com/labstack/gommon/random" in any of:
        G:\GO\go\src\github.com\labstack\gommon\random (from $GOROOT)
        C:\Users\Administrator\go\src\github.com\labstack\gommon\random (from $GOPATH)

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

2272 次点击  ∙  1 赞  
加入收藏 微博
6 回复  |  直到 2017-08-10 19:23:09
channel
channel · #1 · 8年之前

我试了下,没有问题。感觉你的 GOPATH 包含了多个路径(当然,应该跟这个没啥关系)。

可以这样试试:go get -v -u github.com/labstack/echo,看输出过程!

jthmath
jthmath · #2 · 8年之前

网卡了,多试几次即可

caozhiheng0625
caozhiheng0625 · #3 · 8年之前
channelchannel #1 回复

我试了下,没有问题。感觉你的 GOPATH 包含了多个路径(当然,应该跟这个没啥关系)。 可以这样试试:`go get -v -u github.com/labstack/echo`,看输出过程!

G:\GO\go\src\project>go get -v -u github.com/labstack/echo
github.com/labstack/echo (download)
github.com/labstack/gommon (download)
# cd C:\Users\Administrator\go\src\github.com\labstack\gommon; git pull --ff-only
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.
package github.com/labstack/gommon/color: exit status 1
package github.com/labstack/gommon/log: cannot find package "github.com/labstack/gommon/log" in any of:
        G:\GO\go\src\github.com\labstack\gommon\log (from $GOROOT)
        C:\Users\Administrator\go\src\github.com\labstack\gommon\log (from $GOPATH)
Fetching https://golang.org/x/crypto/acme/autocert?go-get=1
https fetch failed: Get https://golang.org/x/crypto/acme/autocert?go-get=1: dial tcp 216.239.37.1:443: 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.
package golang.org/x/crypto/acme/autocert: unrecognized import path "golang.org/x/crypto/acme/autocert" (https fetch: Get https://golang.org/x/crypto/acme/autocert?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a peri
od of time, or established connection failed because connected host has failed to respond.)

这。。。。。

caozhiheng0625
caozhiheng0625 · #4 · 8年之前
jthmathjthmath #2 回复

网卡了,多试几次即可

说实话 试了n次

alphayan
alphayan · #5 · 8年之前

因为echo用到了golang.org的某些包,而这些包又不在墙内,所以你需要网络翻墙。 还有你把gopath放到c盘有些不安全,万一不是管理员写不进去。

fengqc
fengqc · #6 · 8年之前

这类问题想要一劳永逸的话,设置好http代理即可。

添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传