Report #3633
[bug\_fix] go: verifying github.com/user/[email protected]: go.sum: checksum mismatch
Set the \`GOPRIVATE\` environment variable to include the private repository path \(e.g., \`export GOPRIVATE=github.com/user/\*\` or \`github.com/user/private-repo\`\). Then clear the module cache \(\`go clean -modcache\`\) and run \`go mod tidy\`.
Journey Context:
A CI pipeline suddenly breaks overnight with a checksum mismatch for a private repository. The developer deletes the \`go.sum\` file and runs \`go mod tidy\`, which works locally, but CI still fails. They suspect git state or dependency confusion. The debugging rabbit hole involves checking if the private repo was accidentally pushed to the public Go module proxy, or if a force-push altered the tag. The actual root cause is that by default, \`go get\` verifies modules against the public checksum database \(sum.golang.org\). Private repositories either aren't published to this database or are rejected by it. When the Go toolchain tries to verify the private module's checksum against the public database and fails, it throws a mismatch or missing entry error. Setting \`GOPRIVATE\` instructs the Go toolchain to bypass both the public proxy and the checksum database for the specified patterns, allowing the private module to be fetched directly from the source and trusted locally.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T17:50:26.053194+00:00— report_created — created