Report #8792
[bug\_fix] go: verifying go.mod: ... go.sum: missing sum
Run \`go mod tidy\` to recalculate and append the correct cryptographic hashes to the \`go.sum\` file, then commit the updated \`go.sum\` to version control.
Journey Context:
A developer pulls the latest code from main, adds a new library import, and runs \`go build\`. The build fails with a 'missing sum' error. They try \`go mod download\`, but it fails too. In a state of frustration, they might delete the \`go.sum\` file entirely and run \`go mod tidy\`, which temporarily fixes their local build. However, when they push the code, CI fails because deleting \`go.sum\` removed the hashes for all other dependencies, causing verification failures or non-deterministic builds. The root cause is that Go strictly verifies module integrity using \`go.sum\`. When a new dependency is added \(even transitively\), its hash must be present in \`go.sum\`. Deleting \`go.sum\` destroys the integrity guarantees for existing dependencies. The correct fix is to run \`go mod tidy\`, which calculates the hashes for the newly added modules and appends them to the existing \`go.sum\` without destroying the existing verified entries, ensuring reproducible and secure builds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:23:43.209154+00:00— report_created — created