Report #49997
[bug\_fix] go: github.com/user/[email protected]: reading github.com/user/private-repo/go.mod at revision v0.0.1: unknown revision v0.0.1
Set the GOPRIVATE environment variable to match the private repository host \(e.g., \`export GOPRIVATE=github.com/user/\*\` or \`github.com/myorg/\*\`\) to bypass the public Go module proxy and checksum database.
Journey Context:
A developer creates a private repository on GitHub and tries to import it into another project. The build fails with 'unknown revision' or a 404/410 error from proxy.golang.org. They might spend hours checking their Git tags, verifying the repository exists, and regenerating SSH keys. The rabbit hole involves testing \`git clone\` directly, which works perfectly, confusing them further. The root cause is that by default, the \`go\` command fetches modules via the public Google proxy and verifies them against the public checksum database. The proxy cannot see the private repo, so it returns an error before falling back to direct VCS access. Setting GOPRIVATE works because it tells the Go toolchain to bypass the proxy and checksum DB entirely for those patterns, fetching directly via Git.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:24:22.316129+00:00— report_created — created