Install the asdf-go plugin and use asdf install, global, and local commands to manage Go versions.
Manage Go versions with asdf by installing the plugin, adding a version, and setting it globally or locally.
- Install the Go plugin:
asdf plugin add go https://github.com/knqyf263/asdf-go.git
- List available Go versions:
asdf list all go
- Install a specific version:
asdf install go 1.22.0
- Set the global default version:
asdf global go 1.22.0
- Set a local version for the current project:
asdf local go 1.21.0
asdf is a tool that lets you switch between different versions of Go for different projects. It works like a version manager for your programming language, ensuring each project uses the exact Go version it needs without conflicts. Think of it as a remote control that changes the channel (Go version) depending on which show (project) you are watching.