Report #14800
[bug\_fix] go: verifying go.mod: ... go.sum: missing
Run \`go mod tidy\` to recalculate and populate the missing entries in \`go.sum\`, then commit the updated \`go.sum\` to version control.
Journey Context:
A developer adds a new third-party dependency to their code and runs \`go build\` locally. It succeeds, so they push the code and updated \`go.mod\` to version control, but they forget to commit the updated \`go.sum\` file. The CI pipeline subsequently fails with 'go.sum: missing'. The developer is confused because the build worked perfectly on their machine. They dive into a rabbit hole of checking their local Go version versus the CI Go version, and trying to manually edit \`go.sum\`. The root cause is that commands like \`go build\` or \`go test\` automatically append missing checksums to \`go.sum\` locally, but strict CI environments often run with \`GOFLAGS=-mod=readonly\` or \`GONOSUMCHECK\` disabled, preventing the CI runner from modifying \`go.sum\` on the fly. \`go mod tidy\` fixes this because it explicitly resolves all transitive dependencies, calculates their cryptographic hashes, and writes them to \`go.sum\`, ensuring the CI runner has the verification data it needs without needing to mutate the file.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:25:36.916155+00:00— report_created — created