从GCP源代码仓库获取

huangapple go评论82阅读模式
英文:

Go get from GCP source repositories

问题

我正在尝试从GCP源代码库中使用go get命令获取一个仓库。这个过程似乎文档非常非常不完善,但我尝试的方法是运行go get source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git

但是我遇到了错误:

go: 正在下载 source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git v0.0.0-20210621185528-a62b060bc13d

go get: source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d: 验证模块:source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d 时出错:读取 https://sum.golang.org/lookup/source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d 时出错:410 Gone
服务器响应:
未找到:source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d:无效的版本:git fetch -f origin refs/heads/:refs/heads/ refs/tags/:refs/tags/ in /tmp/gopath/pkg/mod/cache/vcs/3eb4fda67ba3d1beb54fafd4a7594a34c06a66c44b1ffd91759a1b7362ecfa4d: exit status 128:
fatal: 无法连接到 source.developers.google.com:
source.developers.google.com[0: 173.194.200.82]: errno=Connection refused
source.developers.google.com[1: 2607:f8b0:4003:c0d::52]: errno=Connection refused

我该如何使其工作?

英文:

I'm trying to go get a repository from GCP Source repositories.
This seems to be very very poorly documented but what I tried to do was running go get source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git.

But I got the error:

go: downloading source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git v0.0.0-20210621185528-a62b060bc13d

go get: source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d: verifying

module: source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d: reading https://sum.golang.org/lookup/source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d: 410 Gone
server response:
not found: source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git@v0.0.0-20210621185528-a62b060bc13d: invalid version: git fetch -f origin refs/heads/:refs/heads/ refs/tags/:refs/tags/ in /tmp/gopath/pkg/mod/cache/vcs/3eb4fda67ba3d1beb54fafd4a7594a34c06a66c44b1ffd91759a1b7362ecfa4d: exit status 128:
fatal: unable to connect to source.developers.google.com:
source.developers.google.com[0: 173.194.200.82]: errno=Connection refused
source.developers.google.com[1: 2607:f8b0:4003:c0d::52]: errno=Connection refused

How can I make it work?

答案1

得分: 1

通过添加GOPRIVATE=source.developers.google.com进行修复。似乎go mod尝试使用一个被Source拒绝的公共连接。

英文:

Fixed by adding GOPRIVATE=source.developers.google.com. Seems that go mod was trying to use a public connection which was being refused by Source.

huangapple
  • 本文由 发表于 2021年6月22日 03:51:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/68073929.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定