Report #28940
[bug\_fix] go: github.com/myorg/private-repo@latest: module github.com/myorg/private-repo: reading https://proxy.golang.org/github.com/myorg/private-repo@latest: 404 Not Found
Set the \`GOPRIVATE\` environment variable to include the private repository domain \(e.g., \`export GOPRIVATE=github.com/myorg/\*\` or \`export GOPRIVATE=github.com/myorg/private-repo\`\).
Journey Context:
A developer clones a work repository and runs \`go mod tidy\`, but it fails with a 404 for a dependency hosted on the company's private GitHub org. They verify their SSH keys and \`git clone\` the private repo manually without issue. They spend hours checking Git credentials, trying different Git configurations, and even setting up \`.netrc\` files, but \`go mod\` continues to fail. The rabbit hole happens because \`go mod\` defaults to fetching modules via the public \`proxy.golang.org\`, which cannot access private repositories and returns a 404. Setting \`GOPRIVATE\` tells the Go toolchain to bypass the public proxy and checksum database, and fetch the module directly from the source repository using the underlying VCS \(which uses the developer's already-working Git/SSH credentials\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:58:10.248811+00:00— report_created — created