go module_error ai_generated true

go: github.com/foo/[email protected]: 未知修订版本 v1.4.0

go: github.com/foo/[email protected]: unknown revision v1.4.0

ID: go/unknown-revision

其他格式: JSON · Markdown 中文 · English
80%修复率
89%置信度
0证据数
2024-02-28首次发现

版本兼容性

版本状态引入弃用备注
1.16+ active — — —
1.21+ active — — —

根因分析

请求的 tag/分支/提交在远程仓库中不存在(或已被删除)。通常由拼写错误或依赖了被重命名的分支导致。

English

The requested tag/branch/commit does not exist in the remote repo (or was deleted). Often caused by typo or by relying on a branch that was renamed.

generic

解决方案

  1. 95% 成功率
    git ls-remote --tags https://github.com/foo/bar
    go get github.com/foo/[email protected]
  2. 85% 成功率
    go get github.com/foo/bar@<sha>
    # go.mod records v0.0.0-<date>-<sha>
  3. 90% 成功率
    go get github.com/foo/bar@latest

无效尝试

常见但无效的做法:

  1. 90% 失败

    the revision still does not exist upstream

  2. 95% 失败

    cache is not the problem; the tag is missing

  3. 90% 失败

    fails with 'replacement directory does not exist'