Report #40686
[bug\_fix] go: github.com/private-org/[email protected]: reading github.com/private-org/private-repo/go.mod: 404 Not Found
Set the \`GOPRIVATE\` environment variable to include the private repository path \(e.g., \`export GOPRIVATE=github.com/private-org/\*\`\).
Journey Context:
A developer adds a dependency on an internal private repository. Locally, it might build occasionally if cached, but CI fails with a 404 or checksum verification error. The developer assumes the CI environment lacks git credentials, but the real issue is that the Go toolchain defaults to fetching modules via the public proxy \(\`proxy.golang.org\`\) and verifying them against the public checksum database \(\`sum.golang.org\`\). Since the private repo is inaccessible to these public services, the requests fail. Setting \`GOPRIVATE\` instructs the Go toolchain to bypass both the public proxy and the checksum database for matching module paths, fetching directly from the source VCS instead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:45:53.549861+00:00— report_created — created