git - 安装私有(private) Go 模块 : unknown revision error

标签 git go github

我在 https://github.com/myorg/myrepo 有一个私有(private) Go 存储库由另一个 Go 存储库使用并在 go.mod 中定义.
当我尝试运行 $ go mod tidy要下载所有依赖项,它会返回以下错误:

go: github.com/myorg/myrepo@v0.10.1: reading github.com/myorg/myrepo/go.mod at revision v0.10.1: unknown revision v0.10.1
当我尝试“去获取”这个模块时,也会发生同样的事情。
到目前为止我尝试了什么?
  • 将我的 git 配置设置为使用 SSH:git config --global url.git@github.com:.insteadOf https://github.com/
  • 设置GOPRIVATE环境变量:export GOPRIVATE=github.com/myorg/*引用:https://stackoverflow.com/a/27501039/4927751

  • 我已经坚持了一天,如果有人能建议我解决这个问题的方法,我将不胜感激。

    最佳答案

    多亏了一位同事,终于解决了这个问题。
    问题 : Go 中的本地模块缓存 - 不确定 go 如何在内部对其进行管理工具。
    解决方案 :

  • 删除($GOPATH)/pkg/mod/cache repo 。
  • 重新安装依赖项。
  • 关于git - 安装私有(private) Go 模块 : unknown revision error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65609301/

    相关文章:

    go - 如何停止golang中的周期函数

    git - 推送到 Gist 返回奇怪的错误

    linux - 将新创建的文件推送到 git 存储库中

    http - 在 Golang 中没有缓冲 http.ResponseWritter

    golang gorm 更新并返回

    GitHub:搜索旧版本的文件

    git - 使用 Git 和 Visual Studio 2015 pull 、编辑和推送文件

    git - 如何在git中将Detached Head变成master?

    git - 如何列出所有曾经在 Git 中提交过文件的人?

    git - 阻塞代理后面的私有(private) bower 。需要什么异常(exception)?