How to Uninstall Go Completely

Cli
Uninstall Go by deleting the /usr/local/go directory and removing GOROOT and GOPATH from your shell environment variables.

To uninstall Go completely, delete the installation directory and remove the environment variables from your shell configuration.

sudo rm -rf /usr/local/go
sudo rm -rf ~/go
unset GOPATH
unset GOROOT
unset PATH

Edit your shell profile (e.g., ~/.bashrc, ~/.zshrc) to remove any lines exporting GOROOT, GOPATH, or adding $GOROOT/bin to PATH, then run source ~/.bashrc (or the equivalent for your shell).