go build_error ai_generated true

go: example.com/[email protected]:验证模块:校验和不匹配 下载的:h1:abc123 go.sum: h1:xyz789

go: example.com/[email protected]: verifying module: checksum mismatch downloaded: h1:abc123 go.sum: h1:xyz789

ID: go/checksum-mismatch

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

版本兼容性

版本状态引入弃用备注
1.11 active
1.12 active
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.sum 中记录的哈希不匹配,表明可能被篡改或损坏。

English

The downloaded module's content does not match the hash recorded in go.sum, indicating possible tampering or corruption.

generic

解决方案

  1. 85% 成功率 Clear module cache and re-download
    go clean -modcache && go mod download
  2. 70% 成功率 Set GONOSUMCHECK to bypass verification for that module (temporary)
    export GONOSUMCHECK=example.com/module && go mod download

无效尝试

常见但无效的做法:

  1. Manually editing go.sum to match the downloaded hash 90% 失败

    This bypasses security; the downloaded module may be malicious or corrupted.

  2. Ignoring the error with -insecure flag 95% 失败

    Go does not support -insecure for module verification; it will still fail.