Go Module Proxy Questions People Keep Asking

Go does not have a central upload step like npm or PyPI. You push a tag to your repository, and the toolchain fetches it, by default through the public module mirror and verified against the checksum database. That design is elegant but surprises newcomers, and the same questions about it surface in Go forums every week. The Go Modules Reference is the authoritative source; these are short, practical answers.

I pushed a new tag. Why does go get still fetch the old version?

When you ask for @latest, the proxy may serve a cached answer for a short while. Requesting the exact version, for example go get example.com/mylib@v1.4.0, makes the proxy fetch that tag from the origin if it has not seen it yet. After that, the version is cached and @latest will catch up. Make sure the tag is a valid semantic version with the leading v; a tag like 1.4.0 is ignored.

I deleted a bad tag. Why can people still download it?

The mirror and the checksum database are designed so that a version, once fetched, keeps resolving to the same content. That protects users from a repository owner, or an attacker, swapping code under an existing version. Deleting or moving a tag does not remove it from the mirror. The supported fix is to publish a new version and mark the bad one with a retract directive in go.mod. Never re-tag the same version with different code: anyone with the old checksum recorded will get a verification error.

How do I use private modules without leaking their names?

Set GOPRIVATE to a pattern matching your private module paths. Matching modules are fetched directly from source and skipped for checksum database lookups, so their paths are not sent to public services:

go env -w GOPRIVATE=git.example.internal/*,github.com/your-org/private-*

The finer-grained GONOPROXY and GONOSUMDB variables exist when you need to control the two behaviours separately, for example when you run an internal proxy.

Can my company run its own proxy?

Yes. GOPROXY accepts a comma-separated list, and any server implementing the module proxy protocol described in the Go Modules Reference can be used. Teams often do this to cache dependencies, keep builds working when the origin is unavailable, and audit what gets pulled in.

go env -w GOPROXY=https://proxy.example.internal,https://proxy.golang.org,direct

What does verifying module: checksum mismatch mean?

The content you downloaded does not match the hash recorded in your go.sum or in the checksum database. The common innocent cause is a re-tagged version. The less innocent one is tampering. Either way, do not just delete go.sum to make the error go away; find out which version changed and why.

Maintainer checklist for proxy-friendly releases

Related pages