Apps

Go Module Cache

Go stores downloaded module source archives and metadata in the module download cache under pkg/mod/cache so builds can reuse versioned dependencies without fetching them again. That cache contains version zip files, extracted module trees, checksum and version list metadata, and VCS fetch state used by the go command during dependency resolution. Kudu removes the cached module download data so corrupted or stale dependency artifacts can be fetched and rebuilt cleanly, without touching your source code, go.mod, go.sum, editor settings, or credentials.

Why clean Go Module Cache?

  • A truncated or corrupted module zip in the download cache causes go build or go mod download to fail with checksum, unexpected EOF, or unzip errors until that version is fetched again
  • Stale version list and metadata under the cache can make newly published tags appear missing, so go get reports unknown revision even though the module exists upstream
  • Interrupted proxy or VCS downloads leave partial cache state behind, which shows up as repeatable dependency resolution failures on every build of the same project
  • The module cache grows indefinitely across projects and Go versions, so old zip archives and extracted dependency trees can consume many gigabytes and leave little free disk space
  • Read-only cached module trees and mixed ownership from sudo or CI runs can trigger permission denied errors when tools scan dependencies, especially after moving between environments
  • Checksum metadata mismatches in cached downloads cause repeated verification failures and blocked builds until the bad module copy is removed and re-downloaded
  • Large extracted module directories accumulate fragmented filesystem space over time, so cleaning the cache can reclaim disk and reduce slow directory scans during dependency-heavy builds
What gets cleaned

Cache paths Kudu targets

Windows

~/go/pkg/mod/cache

macOS

~/go/pkg/mod/cache

Linux

~/go/pkg/mod/cache
Frequently asked

Common questions about Go Module Cache

Free & open source

Download Kudu and reclaim your disk space.

Available on Windows, macOS, and Linux. No account required, no feature gates, no telemetry without consent. All cleaning targets are open source and community-auditable.