Report #6958
[bug\_fix] go: @: reading /go.mod at revision : unknown revision
Set the GOPRIVATE environment variable to match the private module path \(e.g., GOPRIVATE=corp.example.com/\*\) to bypass the public proxy.
Journey Context:
A team sets up a CI pipeline for a project that depends on an internal private library hosted on their corporate GitHub Enterprise server. The build fails with an unknown revision error. The developer can build locally without issues. They assume the CI runner lacks Git credentials, so they spend days configuring SSH keys, .gitconfig, and insteadOf rules in the CI environment. Despite Git clones working perfectly, the Go build still fails. The rabbit hole leads them to the GOPROXY environment variable. By default, Go tries to fetch modules via \`https://proxy.golang.org\`. The public proxy obviously doesn't have their private code and returns a 404, which Go interprets as an unknown revision. The fix is to set the GOPRIVATE environment variable to their corporate domain \(e.g., \`GOPRIVATE=corp.example.com/\*\`\). This tells the Go toolchain to bypass the public proxy and fetch directly from the configured VCS. This works because it routes the dependency resolution directly to the source of truth, utilizing the CI's Git credentials instead of hitting the public, unauthenticated proxy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:24:10.022605+00:00— report_created — created