Report #46129
[bug\_fix] go: module requires ... but go.sum file does not provide it
Run \`go mod tidy\` to synchronize the go.mod and go.sum files with the actual source code imports, rather than manually editing or relying on partial \`go get\` updates.
Journey Context:
A developer pulls the latest code from Git and runs \`go build\`, which fails complaining about missing go.sum entries. A colleague added a new import but forgot to commit the updated go.sum. The developer tries \`go get ./...\`, which might add some entries but often leaves go.sum in a partial or inconsistent state. They try manually appending the missing hash, which leads to checksum mismatch errors. The rabbit hole ends when they realize that go.sum is a strictly verified manifest of transitive dependencies. The established fix is \`go mod tidy\`, which analyzes the entire module graph, adds missing direct and indirect dependencies, removes unused ones, and perfectly recalculates the cryptographic hashes for go.sum. This works because \`go mod tidy\` ensures the module graph is strictly consistent with the code's actual imports.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:54:09.276187+00:00— report_created — created