Report #74515
[bug\_fix] go: verifying @/go.mod: reading https://sum.golang.org/lookup/@: 404 Not Found
Set the GOPRIVATE environment variable to include the private module's hostname \(e.g., export GOPRIVATE=gitlab.mycompany.com/\*\). The root cause is that the Go toolchain attempts to verify the checksum of all downloaded modules against the public Go checksum database \(sum.golang.org\), which does not contain private modules.
Journey Context:
A company migrates a repository to a private GitLab instance. Developers pull the code and run go build, but it fails with a 404 from sum.golang.org. They initially think the GitLab CI is blocking external requests and whitelist sum.golang.org. The error persists. They try GOFLAGS=-insecure, which doesn't fully bypass the sum database. They dig into the Go modules documentation and discover the GOPRIVATE variable. By setting GOPRIVATE=gitlab.mycompany.com, they instruct the Go toolchain to fetch the module directly from the source and skip the public checksum database verification, resolving the build failure securely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:40:12.290697+00:00— report_created — created