go config_error ai_generated true

go: 无效的模块版本 "v1.0.0.1": 版本必须为 vX.Y.Z 格式

go: invalid module version "v1.0.0.1": version must be of the form vX.Y.Z

ID: go/invalid-semver-version

其他格式: JSON · Markdown 中文 · English
80%修复率
88%置信度
0证据数
2025-06-15首次发现

版本兼容性

版本状态引入弃用备注
1.21 active
1.22 active
1.23 active

根因分析

go.mod 或依赖中的版本字符串不遵循语义化版本格式。

English

A version string in go.mod or dependency does not follow semantic versioning (semver) format.

generic

解决方案

  1. 95% 成功率 Correct the version to a valid semver string.
    Change 'v1.0.0.1' to 'v1.0.1' or 'v1.0.0' as appropriate.
  2. 85% 成功率 Use a pseudo-version if the module doesn't have a tag.
    Use 'v0.0.0-20250520120000-abc123' format from commit hash.

无效尝试

常见但无效的做法:

  1. Using a version with extra digits like v1.0.0.1-beta. 100% 失败

    Semver does not allow four parts; Go strictly enforces vX.Y.Z.

  2. Removing the 'v' prefix. 90% 失败

    Go requires the 'v' prefix for module versions; without it, it's invalid.