Developers · Go build cache

Is it safe to delete the Go build cache on Mac?

Safe to removeComes back on its own
~/Library/Caches/go-build

Updated October 17, 2026By the MoreRoom team, Yando Pte. Ltd.This page as Markdown

The short answer

Yes. Rebuilt or re-downloaded automatically when needed.

What is it?

The Go command stores compiled packages and test results in ~/Library/Caches/go-build so that unchanged code is not rebuilt. It periodically deletes entries that have not been used recently on its own, but it can still reach a few gigabytes.

What happens if you delete it?

Go rebuilds what it needs on the next build or test run, so those runs are slower once. No source code or modules are affected.

How to remove it properly

Run go clean -cache in Terminal, the official command, which deletes the cache permanently; go env GOCACHE shows its location.

Use the tool’s official command: go clean -cache

How MoreRoom helps

MoreRoom recognises this item, shows its real size and when it was last used, and labels it “Safe to remove”. In the free version you can move it to the Trash in one click, with Undo; Pro collects every safe item at once.

When the tool is installed, MoreRoom runs its official command for you (go clean -cache) instead of deleting files — and tells you that this step can’t be undone.

Frequently asked questions

Is it safe to delete the Go build cache on Mac?

Yes. Rebuilt or re-downloaded automatically when needed. Go rebuilds what it needs on the next build or test run, so those runs are slower once. No source code or modules are affected.

Will Go build cache come back after I delete it?

Yes. Go rebuilds what it needs on the next build or test run, so those runs are slower once. No source code or modules are affected.

How do I remove Go build cache properly?

Run go clean -cache in Terminal, the official command, which deletes the cache permanently; go env GOCACHE shows its location.

Guides that mention it

Related folders