go build_error ai_generated true

go: example.com/[email protected]: invalid pseudo-version: does not match version-control timestamp

ID: go/invalid-pseudo-version

Also available as: JSON · Markdown · 中文
80%Fix Rate
82%Confidence
0Evidence
2024-09-14First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.13 active
1.14 active
1.15 active
1.16 active
1.17 active
1.18 active
1.19 active
1.20 active
1.21 active
1.22 active
1.23 active

Root Cause

A pseudo-version in go.mod has a timestamp or commit hash that does not correspond to any actual commit in the repository.

generic

中文

go.mod 中的伪版本具有与存储库中任何实际提交不对应的时间戳或提交哈希。

Workarounds

  1. 90% success Use 'go get' to fetch the correct pseudo-version from the repository
    go get example.com/module@master
  2. 85% success Run 'go mod tidy' to let Go resolve the correct version
    go mod tidy

Dead Ends

Common approaches that don't work:

  1. Trying to use 'go mod edit -replace' with a different pseudo-version 80% fail

    Any incorrect pseudo-version will trigger the same validation error.

  2. Deleting the pseudo-version from go.mod manually 70% fail

    Removing it without replacement will cause missing dependency errors.