Go Build Cache
Go stores compiled package objects, test result entries, fuzzing artifacts, and action metadata in its build cache so repeated builds can reuse previous work instead of recompiling every package from source. That cache lives under the per-user go-build directory and is keyed from source files, compiler flags, environment details, and toolchain inputs, but it can still grow large or hold entries that no longer help after branch switches, toolchain changes, or dependency churn. Kudu removes the cached build artifacts and metadata so the next go build or go test starts from a clean cache without touching source code, modules, credentials, or project settings.
Why clean Go Build Cache?
- Old compiled package archives from a previous toolchain or flag set can no longer be reused, so builds spend time scanning a large cache before recompiling anyway and you notice slower incremental builds
- After switching branches or rebasing heavily, cached action results for many package states accumulate and the go-build directory can consume gigabytes even though your current project no longer needs most of them
- Stale cached test results can make go test return fast cached passes when you expected a full rerun, leading to confusing output until the cache is cleared or bypassed
- Corrupted cache entries from an interrupted build, disk error, or abrupt shutdown can trigger unexpected rebuild loops or obscure compile failures that disappear after forcing a fresh cache
- Fuzzing artifacts and prior test execution data can pile up under the build cache, increasing disk usage and making CI workstations or developer laptops run low on space
- When many tiny cache files accumulate, filesystem overhead increases and package discovery plus cache lookups become noticeably sluggish during builds on slower disks or network-backed home directories
- The build cache is content-addressed and disposable, so clearing it is a safe way to rule out cache-related build oddities without deleting source files, modules, editor settings, or saved credentials
Cache paths Kudu targets
Windows
%LocalAppData%/go-build |
macOS
~/Library/Caches/go-build |
Linux
~/.cache/go-build |
Common questions about Go Build Cache
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.