游泳的石头
2018-11-24 11:10
D:\gowork>go get github.com/go-xorm/cmd/xorm
package cloud.google.com/go/civil: unrecognized import path "cloud.google.com/go/civil" (https fetch: Get https://cloud.google.com/go/civil?go-get=1: dial tcp 172.217.161.142:443: connectex: A connection attempt failed because th
e connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
有两个库不能墙内访问 civil crypto.所以我们需要迂回一下安装。
可以直接用 git clone github.com 上的库。这两个库都可以在GitHub上找到。
go get github.com/go-xorm/cmd/xorm 失败 timeout cd ($GOPATH/src)/golang.org/x git clone https://github.com/golang/crypto.git cd ($GOPATH)/src/cloud.google.com/ git clone https://github.com/googleapis/google-cloud-go.git cd cloud.google.com 将 google-cloud-go 目录名更改为 go go install github.com/go-xorm/cmd/xorm 安装成功
cd :D:\GOPATH\src\github.com\go-xorm\cmd;git pull --ff-only
fatal:NO remote repository specified.Please,specify either a URL or a remote name form which
bew revisions should be fetched.
package github.com/go-xorm/cmd/xorm:exit status 1
这两个依赖的源代码在github上都有,通过git clone把源代码拉取拉下,然后把 clone下来的源代码的目录 改成与 import path “cloud.google.com/go/civil”相同就可以正常使用了。
https://github.com/googleapis/google-cloud-go
https://github.com/golang/crypto
cloud.google.com下创建一个go文件夹,复制civil 文件夹内容 到 go 文件下
答案整理自思否 @voidint
我同样遇到这个问题:
D:\gitRepo\Go>go get github.com/go-xorm/cmd/xorm
package cloud.google.com/go/civil: unrecognized import path "cloud.google.com/go/civil" (https fetch: Get https://cloud.google.com/go/civil?go-get=1: dial tcp 216.58.221.238: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.)
但当我用外网的服务器的时候就可以安装,估计是被墙了。
[root@localhost go-xorm]# ls
builder cmd core xorm
iris+xorm Go语言开发球星库
7895 学习 · 51 问题
相似问题