# go: /path/to/module 中的 vendor 不一致：
	github.com/foo/bar@v1.2.3: 在 go.mod 中显式 require，但在 vendor/modules.txt 中未标记为 explicit

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

## 根因

vendor/ 目录相对于 go.mod/go.sum 已过期。常见于修改依赖后未重新运行 go mod vendor。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.16+ | active | — | — |
| 1.21+ | active | — | — |

## 解决方案

1. **** (97% 成功率)
   ```
   go mod tidy
go mod vendor
go build -mod=vendor ./...
   ```
2. **** (85% 成功率)
   ```
   go build -mod=mod ./...
   ```

## 无效尝试

- **** — vendor contents still mismatch; next build fails differently (85% 失败率)
- **** — CI configured for vendored builds fails with missing vendor dir (70% 失败率)
- **** — ignores vendor but CI may still require vendoring (50% 失败率)
