Report #5848
[bug\_fix] go: module example.com/private: reading at revision v1.0.0: unknown revision v1.0.0
Set the \`GOPRIVATE\` environment variable to include the private repository domain \(e.g., \`export GOPRIVATE=example.com/private\`\), which tells the Go toolchain to bypass the public proxy and checksum database.
Journey Context:
A developer sets up a private Git repository and creates a module inside it. They push a \`v1.0.0\` tag. In another project, they run \`go get example.com/[email protected]\`. It fails with 'unknown revision'. They verify the tag exists in Git. They try setting up SSH keys, HTTPS tokens, and modifying \`.gitconfig\`, but the error persists. The debugging rabbit hole leads them to check the Go module proxy. By default, Go uses \`proxy.golang.org\`. The proxy tries to fetch the private repo, fails \(because it's private\), and returns an error. The \`GOPRIVATE\` variable tells the \`go\` command to bypass the public proxy and checksum database for matching module paths, fetching directly from the source repository via VCS \(Git\). This fix works because it routes the request directly to the private Git server where the developer has authenticated access, rather than routing through the public proxy which cannot see the private code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:22:37.497499+00:00— report_created — created