Apps

Go Build Cache

Go stores compiled package objects, test results, and intermediate action outputs in its build cache so repeated builds can reuse previous work instead of recompiling every dependency. That cache lives under the per-user go-build directory and can grow large across different branches, toolchain versions, build tags, and test runs. Kudu clears these cached .a package artifacts, cached test outputs, and other build action results so the next go build or go test recreates them from source without touching your code, modules, settings, or credentials.

Why clean Go Build Cache?

  • Corrupted or partially written cached package archives can surface as unexpected compile or link failures even when the source tree has not changed
  • A large go-build directory from many branches, architectures, and build tags consumes gigabytes of SSD space, which you notice as low disk space despite small project folders
  • Stale cached test results can make go test return old pass or fail outcomes until the cache is invalidated, confusing CI checks and local debugging
  • After switching Go versions or rebuilding with different compiler flags, leftover action outputs can cause inconsistent rebuild behavior where some packages are reused and others are recompiled unexpectedly
  • Build cache entries accumulated from old dependencies slow cache lookups and make incremental builds feel erratic, with one run finishing instantly and the next recompiling much more than expected
  • If a machine was interrupted during a build or restored from backup, mismatched cache metadata can trigger strange rebuild loops where unchanged packages keep recompiling on every run
What gets cleaned

Cache paths Kudu targets

Windows

%LocalAppData%/go-build

macOS

~/Library/Caches/go-build

Linux

~/.cache/go-build
Frequently asked

Common questions about Go Build 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.