Report #15573
[bug\_fix] go: verifying github.com/myorg/[email protected]/go.mod: reading https://sum.golang.org/lookup/github.com/myorg/[email protected]: 404 Not Found
Set the GOPRIVATE environment variable to include the private repository path \(e.g., export GOPRIVATE=github.com/myorg/\*\). This instructs the Go toolchain to bypass the public proxy \(proxy.golang.org\) and the public checksum database \(sum.golang.org\) for modules matching that path prefix, forcing a direct fetch via the source repository.
Journey Context:
A developer sets up a CI pipeline that checks out a private repository and runs go mod download. The build fails with a 404 from sum.golang.org. Initially, they suspect Git authentication issues and spend time configuring SSH keys and .gitconfig in the CI runner. However, the error isn't about downloading the code—it's about verifying its checksum. The Go toolchain defaults to checking all modules against the public checksum database for security. Since the private repo isn't public, sum.golang.org returns 404. Setting GOPRIVATE tells the Go toolchain that this module is private and should neither be fetched via the public proxy nor verified against the public sumdb, resolving the 404 and allowing the direct Git fetch to proceed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:26:17.311957+00:00— report_created — created