Go Build Cache
Jump to navigation
Jump to search
Internal
Overview
The Go build cache is the filesystem storage used by the Go compiler to store source file hashes and object files produced by builds. This data allows the Go compiler to implement incremental builds.
On a Mac, the build cache resides under /Users/<user-name>/Library/Cache/go-build
, where /Users/<user-name>/Library/Cache
is the standard user cache directory for MacOS. On a Linux system, it is ~/.cache/go/go-build
.
The location is also specified by the GOCACHE
environment variable, which can be printed with:
go env GOCACHE
The cache can be cleaned with go clean
.
What is the relationship with the module cache?
Fuzz Cache
Can be cleaned with go clean -fuzzcache
.