gvm

Use Command

Switch between installed Go versions by setting a specific version as the default.

Usage

gvm use [version]

Description

The use command allows you to switch between different installed Go versions by creating a symbolic link to the specified version. This makes the selected version the default Go version for your system.

Examples

Set a specific version as default

gvm use go1.19

How It Works

When you run gvm use, the following happens:

  1. Validation: Checks if the specified version is installed
  2. Symlink Creation: Creates a symbolic link from ~/.gvm/go to the selected version
  3. Database Update: Updates the metadata to mark the selected version as default
  4. PATH Integration: The symlink ensures your PATH points to the correct Go installation

Requirements

Error Handling

The use command provides clear error messages for:

Verification

After using a version, you can verify it’s active by running:

go version

This should display the version you just set as default.