Report #14426
[bug\_fix] go: github.com/mycompany/[email protected]: reading github.com/mycompany/internal-pkg/go.mod at revision v1.0.0: unknown revision v1.0.0
Set the \`GOPRIVATE\` environment variable to include the private repository path \(e.g., \`export GOPRIVATE=github.com/mycompany/\*\`\) so the Go toolchain fetches it directly rather than through the public proxy.
Journey Context:
A developer tries to add a private internal library to their project using \`go get github.com/mycompany/[email protected]\`. The command fails with 'unknown revision'. They verify the tag exists in the GitHub repository and their SSH keys are set up correctly. They can even \`git clone\` the repo manually. Frustrated, they clear the module cache and try again, but the error persists. The rabbit hole leads them to discover the \`GOPRIVATE\` environment variable. By default, the \`go\` command routes all module fetches through the public Go module proxy \(\`proxy.golang.org\`\) and checksum database. The public proxy cannot access the private GitHub repository, so it returns a 404, which the Go toolchain translates to 'unknown revision'. Setting \`GOPRIVATE=github.com/mycompany/\*\` tells the Go toolchain to bypass the public proxy and fetch the module directly from the source repository, allowing the build to succeed using their existing Git credentials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:26:52.628488+00:00— report_created — created