Packages, modules and tooling · 3 MIN READ
Checksums, proxies and private modules solve different problems
Diagnose downloads without leaking private paths or disabling integrity checks globally.
A download failure may come from version discovery, credentials, a proxy, the checksum database or local cache integrity. Treat those as separate layers. A checksum records content identity; it neither proves the code is safe nor decides which version the dependency graph chooses.
Packages and production tooling · A MAP OF THE IDEA
- Discover version
- Fetch source
- Verify content
- Build selected graph
Useful when
- Diagnose downloads without leaking private paths or disabling integrity checks globally.
Watch out
- A checksum verifies the expected content of a version. It does not select that version, certify its behavior or establish that no vulnerability is known.
Implementation & operation cost: Private fetches need reliable credentials and transport; retaining integrity checks makes failures easier to investigate.
Inspect effective settings
Read configuration before changing it. Private module patterns affect how the Go command consults public services; they do not log you in to a private repository. Use the environment and credential mechanisms approved for that repository, and keep tokens out of module URLs and command history.
go env GOPROXY GOPRIVATE GONOPROXY GONOSUMDB
go mod download -json
go mod verifyThe commands distinguish download provenance and local verification from compilation. Download JSON can contain private module paths, so inspect it locally and redact paths before sharing an incident report.
Scope private paths narrowly
GOPRIVATE is a pattern list for private module path prefixes. Configure a company-specific pattern in the environment of the developer shell and CI job. GOPROXY fallback with comma versus pipe has different failure behavior; choose deliberately instead of masking every proxy error with direct access.
# Example only: replace the organization path.
GOPRIVATE=github.com/example-company/* go mod downloadThe assignment applies to this one command rather than silently altering every future shell. It still needs separately configured repository credentials and a network route to the source.
Keep integrity and availability separate
A checksum mismatch deserves investigation of the module version, proxy and local files. Do not teach a build to accept changed content under an existing version. go.sum can include go.mod checksums for modules whose source is not used, and it may change after tidy without representing a new executable dependency.
TAKE THIS WITH YOU
Trace discovery, transport, credentials and checksums independently. Narrow private patterns and preserve integrity verification for public dependencies.
Check your understanding
What does a go.sum entry establish?
Go to the source
Progress stays in this browser. No account needed.