go
build_error
ai_generated
true
缺少提供包 github.com/foo/bar 的模块的 go.sum 条目;要添加:go mod download github.com/foo/bar
missing go.sum entry for module providing package github.com/foo/bar; to add: go mod download github.com/foo/bar
ID: go/go-sum-missing-entry
80%修复率
88%置信度
0证据数
2024-02-25首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.16 | active | — | — | — |
| 1.23 | active | — | — | — |
根因分析
依赖已添加到 go.mod 但 go.sum 未更新,通常因为使用 -mod=mod 而未运行 tidy。
English
A dependency was added to go.mod but go.sum was not updated, often due to using -mod=mod without tidy.
解决方案
-
95% 成功率
go mod tidy
-
90% 成功率
go mod download github.com/foo/bar
无效尝试
常见但无效的做法:
-
40% 失败
This will regenerate all entries but may take time and cause network issues.
-
100% 失败
The hash must match exactly; a random hash will cause checksum mismatch.