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

go get github.com/go-xorm/cmd/xorm 安装失败


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.)


正在回答

4 回答

xorm cmd 墙内安装

有两个库不能墙内访问 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 安装成功


1 回复 有任何疑惑可以回复我~
#1

来碗稀豆粉

试验后可行,接下来如果报 zsh: command not found: xorm 需要进到xorm目录编译下方能使用 cd ($GOPATH)/src/github.com/go-xorm/cmd/xorm go build 添加当前目录到PATH变量
2019-03-26 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

这两个依赖的源代码在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


0 回复 有任何疑惑可以回复我~

我同样遇到这个问题:

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


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

go get github.com/go-xorm/cmd/xorm 安装失败

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信