How to uninstall Go on a Mac, from Homebrew or the official installer
Remove Go installed with Homebrew or the go.dev installer, and the module cache and tools folder that stay in your home folder after it goes.
How do I uninstall Go on a Mac?
Find out how it was installed with which -a go, then remove each copy:
- Homebrew (
/opt/homebrew/bin/go):brew uninstall go. Ours, version 1.25.1, was 232 MB. - Official installer (
/usr/local/go/bin/go):sudo rm -rf /usr/local/go, then remove/etc/paths.d/go, andsudo pkgutil --forget org.golang.go.
On our Mac which -a go found only the Homebrew copy; /usr/local/go did not exist.
What does Go leave behind?
Your Go workspace, ~/go by default: downloaded modules in ~/go/pkg/mod and tools you installed with go install in ~/go/bin. Module files are read only, so use go clean -modcache before uninstalling, or move ~/go to the Trash in Finder afterwards. The build cache is in ~/Library/Caches/go-build.
If you are keeping Go and only short of space: Go's module cache.
Common questions
How do I completely remove Go from my Mac?
Remove the Go install (brew uninstall go, or /usr/local/go for the official installer), then the ~/go workspace and ~/Library/Caches/go-build.
Why can't I delete the go folder on Mac?
Go marks downloaded module files read only. Run go clean -modcache before uninstalling.