Report #10354
[bug\_fix] go: verifying github.com/foo/[email protected]: checksum mismatch
Run \`go clean -modcache\` to clear the local module cache, then \`go mod download\`. If the dependency is private, ensure \`GONOSUMDB\` is set correctly, but for public dependencies, the mismatch is almost always due to a mutated tag in the cache.
Journey Context:
A developer pulls the latest code and runs \`go build\`. The build fails with a checksum mismatch for a specific dependency. They try \`go mod tidy\` and \`go mod download\`, but the error persists. They check \`go.sum\` and it matches the remote repository's \`go.sum\`. The rabbit-hole begins: they suspect a supply chain attack or a corrupted proxy. They check the Go module proxy \(proxy.golang.org\) and realize someone force-pushed a new commit to the v1.0.0 tag, or the developer previously fetched the old v1.0.0 tag into their local cache. The Go toolchain caches the go.sum of the first download and compares subsequent downloads against it. Since the tag was mutated, the proxy serves the new hash, but the local cache expects the old one, or vice versa. The fix is to clear the local module cache using \`go clean -modcache\`, which removes the stale cached checksum, allowing the toolchain to fetch the current version and update the go.sum file appropriately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:23:43.235090+00:00— report_created — created