go
build_error
ai_generated
true
go: inconsistent vendoring: vendor directory is missing, but -mod=vendor is set. Run 'go mod vendor'.
ID: go/vendor-directory-not-present
80%Fix Rate
86%Confidence
0Evidence
2024-06-02First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.14 | active | — | — | — |
| 1.20 | active | — | — | — |
Root Cause
The project is configured to use vendoring (via -mod=vendor or GOFLAGS), but the vendor directory doesn't exist.
generic中文
项目配置为使用 vendoring(通过 -mod=vendor 或 GOFLAGS),但 vendor 目录不存在。
Workarounds
-
95% success
go mod vendor
-
80% success
go build -mod=mod
Dead Ends
Common approaches that don't work:
-
100% fail
Go expects specific files like modules.txt; empty dirs won't satisfy the build.
-
50% fail
You may not control the build environment; the flag may be set in CI.