-u flag removes an installed Go version from your workspace, including its extracted toolchain directory. If the version being removed is currently active, the workspace symlinks and version file are also removed.
Syntax
The Go version to uninstall in
X.Y.Z format (e.g. 1.22.6).Examples
What it does
Check the workspace
igo verifies that the workspace directory exists and that there is an active version recorded in
~/go/version.Remove sticky and permission bits
The sticky bit and setuid/setgid bits are removed from the version directory at
~/go/versions/<version>. This reverses the protections applied at the end of installation, making the directory safe to delete.Remove active symlinks (if applicable)
If the version being uninstalled matches the currently active version, igo removes the
bin, path, and root symlinks from the workspace and deletes the ~/go/version file.Make the directory writable
igo recursively makes all files and directories under
~/go/versions/<version> writable to ensure the removal succeeds.