# go: 验证模块失败：校验和不匹配

- **ID:** `go/checksum-mismatch-proxy`
- **领域:** go
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

go.sum 中记录的模块版本校验和与从代理下载的模块内容计算出的校验和不一致，通常由下载缓存损坏或代理被中间人攻击导致。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.17 | active | — | — |

## 解决方案

1. **** (80% 成功率)
   ```
   Remove the problematic module from the module cache: go clean -modcache, then run go mod download to re-download with fresh checksums.
   ```
2. **** (90% 成功率)
   ```
   Use GONOSUMCHECK=* or GONOSUMDB=* to bypass checksum verification for specific modules (temporary, not recommended for production).
   ```

## 无效尝试

- **** — go mod tidy will regenerate go.sum from the proxy, but if the proxy serves corrupted content or is malicious, the same mismatch will recur. (60% 失败率)
- **** — This flag only affects module resolution, not checksum verification; the mismatch persists. (95% 失败率)
