Report #20844
[bug\_fix] unknown revision v1.0.0 or 410 Gone when fetching private modules
Set the \`GOPRIVATE\` environment variable to match the private repository host \(e.g., \`GOPRIVATE=github.com/mycompany/\*\`\) and configure Git to use SSH instead of HTTPS via \`git config --global url."[email protected]:".insteadOf "https://github.com/"\`.
Journey Context:
A company sets up a private Git repository for their shared Go library. A developer adds it as a dependency, but \`go mod tidy\` fails with a \`410 Gone\` or \`unknown revision\` error. The developer is confused because they can clone the repo perfectly fine using \`git clone\`. The issue is that the Go toolchain defaults to fetching modules via \`proxy.golang.org\`. The proxy doesn't have access to the private repo and returns an error. The developer sets \`GOPRIVATE=github.com/mycompany/\*\`, which tells Go to bypass the proxy and fetch directly from GitHub. But then it fails again because the CI runner uses HTTPS without a configured Git credential helper. The final fix combines \`GOPRIVATE\` with the Git \`insteadOf\` configuration, forcing Git to use SSH \(which has the deployed SSH key\) for HTTPS URLs, allowing the Go toolchain to authenticate and download the private module.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:23:36.401126+00:00— report_created — created