Report #10896
[bug\_fix] go: inconsistent vendoring dependencies: MODULE@VERSION is explicitly required in go.mod, but not marked as vendored in vendor/modules.txt
Run \`go mod vendor\` to synchronize the \`vendor\` directory and \`vendor/modules.txt\` with the current \`go.mod\` file.
Journey Context:
A developer working in a project that uses vendoring \(passing \`-mod=vendor\` to the go toolchain\) adds a new dependency using \`go get github.com/foo/bar\`. They run \`go build\` and it fails, complaining about inconsistent vendoring dependencies. The developer tries manually copying the downloaded module into the \`vendor\` directory, but the build still fails. The root cause is that the Go toolchain relies on \`vendor/modules.txt\` as the manifest of all vendored modules, not just the presence of files in the \`vendor\` folder. Manually copying files bypasses this manifest, making the module invisible to the build system. The established fix is to run \`go mod vendor\`, which completely rebuilds the \`vendor\` directory based on \`go.mod\`, correctly populating \`vendor/modules.txt\` with the hashes and versions of all direct and indirect dependencies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:55:24.929539+00:00— report_created — created