Report #15771
[bug\_fix] verifying go.mod: ...: reading at revision ...: unknown revision or go.sum checksum mismatch for private repositories
Set the \`GOPRIVATE\` environment variable to match the private repository hostname \(e.g., \`export GOPRIVATE=gitlab.mycompany.com/\*\`\) to bypass the public Go module proxy and checksum database.
Journey Context:
A developer sets up a CI pipeline for a project that depends on an internal private Git repository. The build fails with a checksum mismatch or an 'unknown revision' error for the internal package. The developer verifies the tag exists in the private repo and is confused why the Go toolchain cannot find it. The root cause is that by default, the \`go\` command fetches modules through the public \`proxy.golang.org\` and verifies them against \`sum.golang.org\`. The public proxy cannot access the private repo, returning errors that manifest as verification or resolution failures. Setting \`GOPRIVATE\` tells the Go toolchain to fetch these modules directly from the source repository and skip the public checksum database, resolving the access issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:55:38.225291+00:00— report_created — created