Report #84338
[bug\_fix] go: github.com/user/[email protected]: reading github.com/user/private-repo/go.mod at revision v1.0.0: unknown revision v1.0.0
Set the \`GOPRIVATE\` environment variable to match the private repository path \(e.g., \`export GOPRIVATE=github.com/user/private-repo\`\) so the \`go\` command fetches directly from the source VCS instead of the public proxy.
Journey Context:
A developer creates a private GitHub repository, tags a release as \`v1.0.0\`, and imports it into another project. The build fails with 'unknown revision'. The developer verifies the tag exists in GitHub and that their SSH keys or Git credentials are correctly configured. They might even try \`git clone\` successfully, making the error seem impossible. The debugging rabbit hole involves checking Git configurations and GitHub permissions. The root cause is that the \`go\` command defaults to fetching modules via the public Go module proxy \(\`proxy.golang.org\`\) and checksum database \(\`sum.golang.org\`\). Since the repository is private, the proxy cannot access it and returns a 404/410, which the \`go\` command translates to 'unknown revision'. Setting \`GOPRIVATE\` tells the Go toolchain to bypass the public proxy and checksum DB for matching module paths, fetching directly from the VCS using the developer's existing Git credentials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:09:03.184256+00:00— report_created — created