# go: 模块 example.com/module@v1.0.0 需要 example.com/dependency@v1.0.0，但 go.sum 缺失或不包含该依赖的哈希值

- **ID:** `go/module-path-mismatch`
- **领域:** go
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

go.sum 文件与 go.mod 文件不同步，通常是由于手动编辑或未完全执行 'go mod tidy' 导致。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.16 | active | — | — |
| 1.17 | active | — | — |
| 1.18 | active | — | — |
| 1.19 | active | — | — |
| 1.20 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |
| 1.23 | active | — | — |

## 解决方案

1. **Run 'go mod tidy' to synchronize go.mod and go.sum** (95% 成功率)
   ```
   go mod tidy
   ```
2. **Run 'go mod download' to fetch missing dependencies and update go.sum** (90% 成功率)
   ```
   go mod download
   ```

## 无效尝试

- **Manually editing go.sum to add the missing hash** — go.sum is a checksum file; manual edits often introduce incorrect hashes, causing verification failures. (85% 失败率)
- **Deleting go.mod entirely and recreating it** — Loses all dependency versions and module path, leading to more complex rebuild issues. (75% 失败率)
