go build_error ai_generated true

go: example.com/[email protected]:无效的伪版本:与版本控制时间戳不匹配

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

ID: go/invalid-pseudo-version

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

版本兼容性

版本状态引入弃用备注
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

根因分析

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

English

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

generic

解决方案

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

无效尝试

常见但无效的做法:

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

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

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

    Removing it without replacement will cause missing dependency errors.