Report #42843
[bug\_fix] missing go.sum entry for module providing package ...
Run 'go mod tidy' to ensure all direct and indirect dependencies are properly recorded in go.mod and go.sum.
Journey Context:
A developer adds a new import to their code, say 'import "github.com/gin-gonic/gin"', and runs 'go build'. It fails with missing go.sum entry. They try 'go build ./...', 'go run main.go', but the error persists. They might manually try to add the hash to go.sum, which leads to further checksum errors. The root cause is that 'go build' does not automatically update go.mod and go.sum for newly added imports in all scenarios \(especially if the module is dirty\). The established fix is to run 'go mod tidy', which adds missing modules and removes unused ones, correctly populating go.sum with the cryptographic hashes fetched from the Go module mirror.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:22:44.269258+00:00— report_created — created