go module_error ai_generated true

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

ID: go/unknown-revision

Also available as: JSON · Markdown · 中文
80%Fix Rate
89%Confidence
0Evidence
2024-02-28First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.16+ active — — —
1.21+ active — — —

Root Cause

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

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 90% fail

    the revision still does not exist upstream

  2. 95% fail

    cache is not the problem; the tag is missing

  3. 90% fail

    fails with 'replacement directory does not exist'