go
build_error
ai_generated
true
go: inconsistent vendoring in /path/to/module: github.com/foo/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
ID: go/inconsistent-vendoring
80%Fix Rate
89%Confidence
0Evidence
2024-05-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.16+ | active | — | — | — |
| 1.21+ | active | — | — | — |
Root Cause
The vendor/ directory is stale relative to go.mod/go.sum. Common after editing dependencies without re-running go mod vendor.
generic中文
vendor/ 目录相对于 go.mod/go.sum 已过期。常见于修改依赖后未重新运行 go mod vendor。
Workarounds
-
97% success
go mod tidy go mod vendor go build -mod=vendor ./...
-
85% success
go build -mod=mod ./...
Dead Ends
Common approaches that don't work:
-
85% fail
vendor contents still mismatch; next build fails differently
-
70% fail
CI configured for vendored builds fails with missing vendor dir
-
50% fail
ignores vendor but CI may still require vendoring