# go: vendoring 不一致：vendor 目录缺失，但设置了 -mod=vendor。请运行 'go mod vendor'。

- **ID:** `go/vendor-directory-not-present`
- **领域:** go
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

项目配置为使用 vendoring（通过 -mod=vendor 或 GOFLAGS），但 vendor 目录不存在。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   go mod vendor
   ```
2. **** (80% 成功率)
   ```
   go build -mod=mod
   ```

## 无效尝试

- **** — Go expects specific files like modules.txt; empty dirs won't satisfy the build. (100% 失败率)
- **** — You may not control the build environment; the flag may be set in CI. (50% 失败率)
