# go: /path/to/project 中 vendoring 不一致：go.mod 要求 github.com/foo/bar v1.4.0 但 vendor/modules.txt 记录的是 v1.2.0

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

## 根因

更新依赖版本后未重新运行 'go mod vendor'，导致 vendor 目录与 go.mod 不同步。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.14 | active | — | — |
| 1.21 | active | — | — |
| 1.24 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   go mod vendor
   ```
2. **** (90% 成功率)
   ```
   go mod tidy && go mod vendor
   ```

## 无效尝试

- **** — Vendor directory contains actual source code and checksums; manual edits cause more inconsistencies and build failures. (95% 失败率)
- **** — If the project is configured for vendoring (with -mod=vendor), removing it causes 'cannot find module' errors unless you switch to network mode. (80% 失败率)
