Install this extension from the VS Code Marketplace or via VSIX.
Reload VS Code to activate the extension.
Usage
Place a .go-version file in your project root containing the Go version you want to use, for example:
go1.23.1
Optionally, add a .go-pkgset file to specify a gvm package set:
my-pkgset
If a .go-version file is not found, the extension will try to detect the Go version from your go.mod file automatically.
When you open the workspace, the extension will automatically run gvm use with the specified version and pkgset. If the version or pkgset does not exist, you will be prompted to install or create them.
Configuration
The extension contributes the following settings:
gvmAutoSwitcher.updateGoEnv: boolean (default: true)
Update workspace go.goroot and go.gopath settings automatically after switching Go versions.
gvmAutoSwitcher.promptOnMissingVersion: boolean (default: true)
Prompt to install missing Go versions when detected.
gvmAutoSwitcher.promptOnMissingPkgset: boolean (default: true)
Prompt to create missing pkgsets when detected.
gvmAutoSwitcher.statusBar.enabled: boolean (default: true)
Show Go version and pkgset in the status bar.
Notes
This extension currently supports macOS, Linux, and WSL environments only.
It is compatible with zsh and Powerlevel10k multi-line prompt injection.
Ensure your shell environment loads gvm properly for the extension to work.