$ go get
在许多Google尝试之后,我正在寻找使用私有存储库的方法。
第一次尝试:
$ go get -v gitlab.com/secmask/awserver-go
Fetching https://gitlab.com/secmask/awserver-go?go-get=1
https fetch failed.
Fetching http://gitlab.com/secmask/awserver-go?go-get=1
Parsing meta tags from http://gitlab.com/secmask/awserver-go?go-get=1 (status code 200)
import "gitlab.com/secmask/awserver-go": parse http://gitlab.com/secmask/awserver-go?go-get=1: no go-import meta tags
package gitlab.com/secmask/awserver-go: unrecognized import path "gitlab.com/secmask/awserver-go
是的,它没有看到元标记,因为我不知道如何提供登录信息。
第二次尝试:
跟随https://gist.github.com/shurcooL/6927554。将配置添加到.gitconfig。
[url "ssh://git@gitlab.com/"]
insteadOf = https://gitlab.com/
$ go get -v gitlab.com/secmask/awserver-go --> not work
$ go get -v gitlab.com/secmask/awserver-go.git --> work but I got src/gitlab.com/secmask/awserer-go.git
是的,它可以工作,但是带有.git
我的项目名称扩展名,我可以将其重命名为原始名称,但是每次$ go get
都做得不太好,还有其他方法吗?
GOPRIVATE
。例如export GOPRIVATE="github.com/steelx/that-private-repo"