Report #7852
[bug\_fix] missing go.sum entry for module providing package X
Run \`go mod tidy\` to ensure go.sum contains the cryptographic hashes for all direct and indirect dependencies before building.
Journey Context:
A developer adds a new import \`import "github.com/new/package"\` to their code and runs \`go build\`. It fails with a missing go.sum entry. Frustrated, they run \`go build ./...\` and it still fails. They remember that in older Go versions, \`go build\` would automatically update go.mod and go.sum, so they assume their Go installation is broken. The rabbit hole involves checking Go versions and manually trying to vendor. The actual root cause is a deliberate behavior change introduced in Go 1.16: \`go build\` no longer modifies go.mod and go.sum by default to ensure reproducible, hermetic builds. The fix is to run \`go mod tidy\`. This works because \`go mod tidy\` is explicitly designed to calculate the exact dependency graph, download missing modules, and populate go.sum with the required cryptographic checksums, satisfying the strict verification requirements of the build command.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:51:56.052710+00:00— report_created — created