Report #16940
[bug\_fix] go: github.com/private/[email protected]: unrecognized import path "github.com/private/repo": reading https://github.com/private/repo?go-get=1: 404 Not Found
Set the \`GOPRIVATE\` environment variable to include the private repository domain \(e.g., \`export GOPRIVATE=github.com/private/\*\` or \`github.com/private/repo\`\).
Journey Context:
A developer works on a private GitHub repository. They can push and pull git changes fine using SSH keys. However, when they run \`go get\` or \`go mod tidy\`, Go tries to fetch the module via HTTPS and hits a 404 because the repo is private and the Go module proxy \(proxy.golang.org\) cannot access it either. The developer might try to mess with \`.gitconfig\` instead of Go settings, or set \`GO111MODULE=off\`. The actual root cause is that Go's default behavior is to route module fetches through the public Google proxy and checksum database for privacy and security. The fix is to tell Go to bypass the proxy and checksum DB for private modules by setting \`GOPRIVATE\`. This makes Go fetch the module directly from the source repository using the configured VCS credentials \(like SSH or \`.netrc\`\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:58:53.145640+00:00— report_created — created