我们的私有(private)组织 GitHub 帐户通过以下方式进行身份验证
当我试图通过
go get
获取 go 模块时这是在私有(private)组织 Github 中unrecognized import path "<repo>/api?go-get=1: no go-import meta tags ()
我找到了一个类似的线程,但该解决方案对我不起作用What's the proper way to "go get" a private repository?
另外,我发现 https://medium.com/@dayakar88/a-guide-to-solve-no-go-import-meta-tags-for-private-repositories-with-go-modules-6b9237f9c9f似乎适合我的情况,但我无法理解解决方案
最佳答案
我已经通过设置 go for non-public modules 来实现这一点将 Github 帐户作为值传递。
并通过配置代理来获取它directly .
或者,您可以强制 go get 命令在 SSH 的 URL 中使用 Github 个人访问 token (如果您让 http://会失败,因为它无法访问存储库)
EXPORT GOPRIVATE=github.com/YOURACCOUNT && \
EXPORT GOPROXY=direct && \
git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf https://github.com/
关于go - "go get"使用两因素身份验证的私有(private) github 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63579880/