我的模块是gitlab.com/getsote/utilities/slogger
我的存储库是gitlab.com/getsote/utilities/slogger.git
当我运行时go get gitlab.com/getsote/utilities/slogger
,我收到以下消息。
Scotts-Mac-mini:seeding syacko$ go get gitlab.com/getsote/utilities/slogger
go get gitlab.com/getsote/utilities/slogger: module gitlab.com/getsote/utilities/slogger: git ls-remote -q origin in /Users/syacko/workspace/sotesoft/golang/pkg/mod/cache/vcs/80b3644beae1b986f1c659355360479e2463820660aa328d2edb1e571aba259b: exit status 128:
remote: The project you were looking for could not be found.
fatal: repository 'https://gitlab.com/getsote/utilities.git/' not found
Scotts-Mac-mini:seeding syacko$
这gitlab.com/getsote/utilities.git
是一个子目录而不是存储库。我不明白为什么go get
要将实用程序作为存储库?
===========================
以前的更新
目录结构:
GOPATH/src/slogger
|----go.mod
|----slogger.go
|----slogger_test.go
go.mod file
module slogger or gitlab.com/getsote/utilities/slogger -> still gets the error below
go 1.14
gitlab.com/getsote/utilities contains repository slogger.git
我已经进行了测试,看看问题是否出在路径中的节点数上。因此,我创建了一个没有子目录的新存储库并推送了 slogger 代码。然后运行go get gitlab.com/getsote/slogger
生成不同的错误消息。
GOPATH/gitlab.com/getsote/test-go-mod -> create new directory and added slogger files listed above
gitblab.com/getsote/test-go-mod -> new repository with one less level
Scotts-Mac-mini:test-go-mod syacko$ go get gitlab.com/getsote/test-go-mod
go: downloading gitlab.com/getsote/test-go-mod v0.0.0-20200409023538-794310bf7cf9
go get gitlab.com/getsote/test-go-mod: gitlab.com/getsote/test-go-mod@v0.0.0-20200409023538-794310bf7cf9: verifying module: gitlab.com/getsote/test-go-mod@v0.0.0-20200409023538-794310bf7cf9: reading https://sum.golang.org/lookup/gitlab.com/getsote/test-go-mod@v0.0.0-20200409023538-794310bf7cf9: 410 Gone
server response:
not found: gitlab.com/getsote/test-go-mod@v0.0.0-20200409023538-794310bf7cf9: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/7753c92c9bd1419156d8120684b7f3707fd207e01a2947ba89e2acfd2ecfb4d0: exit status 128:
fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled
Scotts-Mac-mini:test-go-mod syacko$
对于缺少的版本,这仍然是 128 的状态错误。此外,它正在寻找代码的正确位置。如果这是真的,那么我只需要有关缺少版本的帮助。移动到缩短的目录结构是可行的。
=========================
最新更新
@praveent > https://medium.com/cloud-native-the-gathering/go-modules-with-private-git-repositories-dfe795068db4的解决方案对我不起作用。所以我从头开始看看如何解决这个问题。