Report #47971
[bug\_fix] go: inconsistent vendoring dependencies: ...
Run go mod vendor to synchronize the vendor directory and vendor/modules.txt with the current go.mod file.
Journey Context:
A developer is working on a project that relies on the vendor directory. They add a new dependency using go get github.com/new/dep, which updates go.mod and go.sum. They commit the changes and push, but the CI build fails with 'go: inconsistent vendoring dependencies'. The developer assumes go get automatically updates the vendor directory. They look at the error message, which lists missing packages, and attempt to manually copy the missing module into the vendor/ folder. The root cause is that the vendor directory is a strict snapshot of dependencies, tracked by the vendor/modules.txt manifest. go get only updates go.mod and go.sum, leaving the vendor directory stale and out of sync. The fix works because go mod vendor re-evaluates go.mod, downloads the exact required dependencies, and recreates the vendor directory and its manifest, ensuring they perfectly match the module graph defined in go.mod.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:59:57.124486+00:00— report_created — created