【发布时间】:2020-01-13 02:32:28
【问题描述】:
我正在使用 golang 1.13 。
我有一个依赖于私有 gitlab 项目的项目。
我有相同的 ssh 密钥。
当我尝试检索新创建的模块的依赖项时,我收到以下错误:
$ go version
go version go1.13 linux/amd64
$ go mod why
go: downloading gitlab.com/mycompany/myproject v0.0.145
verifying gitlab.com/mycompany/myproject@v0.0.145: gitlab.com/mycompany/myproject@v0.0.145: reading https://sum.golang.org/lookup/gitlab.com/mycompany/myproject@v0.0.145: 410 Gone
我不知道它为什么要尝试 ping sum.golang.org/lookup,因为它是一个私人 gitlab 项目。
我的 ~/.gitconfig 包含以下内容(基于我在 google 中查找类似错误)
# Enforce SSH
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
[url "ssh://git@gitlab.com/"]
insteadOf = https://gitlab.com/
[url "ssh://git@bitbucket.org/"]
insteadOf = https://bitbucket.org/
[url "git@gitlab.com:"]
insteadOf = https://gitlab.com/
错误仍然存在。
我希望包从我的私人 gitlab 项目存储库下载到当前项目。
我需要在我的私人 gitlab 项目存储库中做些什么来让它为“go get”做好准备吗?
私有 gitlab 项目存储库也已经包含该项目的 go.sum 和 go.mod。
我错过了什么?
edit: 1) 私有仓库名称和公司名称不包含星号或任何其他特殊字符。只有字母,甚至没有数字字符。
【问题讨论】:
-
你会不会碰巧在你的私人仓库中有一个文件名中带有星号的文件?
-
嗯,不。只有字母字符,甚至没有数字。