Report #14623
[bug\_fix] go: github.com/company/[email protected]: reading github.com/company/private-repo/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., go env -w GOPRIVATE=github.com/company/\* or GOPRIVATE=github.com/company/private-repo\) to bypass the public Go module proxy and checksum database.
Journey Context:
A developer adds a dependency on an internal private repository. When they run go mod tidy or go build, the command hangs or fails with an 'unknown revision' or 404 error. They verify the tag exists in their VCS and their git credentials work fine outside of Go. They might try clearing the module cache or using a replace directive, but the error persists. The root cause is that the default GOPROXY is https://proxy.golang.org,direct. The Go toolchain queries the public proxy for the module, which returns a 404 because it's a private repo. Even if it falls back to direct, the GONOSUMDB might not be set, causing checksum validation failures. Setting GOPRIVATE configures the toolchain to bypass both the public proxy and the checksum database for matching module paths, forcing a direct VCS fetch using the local git configuration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:56:46.795088+00:00— report_created — created