Go module cache
Last updated 1 November 2026
What it is, where it lives on your Mac, and whether it’s safe to delete.
Safe to delete
Yes. Go downloads modules again on the next build.
Where it is
~/go/pkg/mod
What it is
Go's module cache holds downloaded module sources and is read-only on disk; go clean -modcache is Go's own way to empty it.
Your projects and go.sum files stay; Go fetches modules again when they build.
Is it safe to delete?
Yes. Go downloads modules again on the next build.
How big is it?
In Terminal, this shows its size without changing anything:
du -sh "$HOME/go/pkg/mod"How to remove it
- Quit go, gopls first.
- Use the tool's own command, which knows what's still in use:
go clean -modcache
What DiskCity does with it
DiskCity removes it with the tool's own command, when you approve, or on its own if you turn on Autopilot. It waits until go is closed.
Sources
Checked 2026-10-23.
