iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
👾
How to Install Multiple Go Versions
There are times when you might want to try out the latest version for a bit.
The official documentation also explains how to install multiple versions.
This time, I will try installing the unstable version, go1.19beta1.
Check the version of Go that is already installed.
❯❯❯ go version
go version go1.18.3 linux/amd64
First, run the following command.
❯❯❯ go install golang.org/dl/go1.19beta1@latest
Next, run the following command.
❯❯❯ go1.19beta1 download
Let's verify if it is installed.
❯❯❯ go1.19beta1 version
go version go1.19beta1 linux/amd64
Now you can run the new version of Go locally by using go1.19beta1 instead of the go command.
To remove it, run the following commands.
❯❯❯ sudo rm $HOME/go/bin/go1.19beta1
❯❯❯ sudo rm -rf $HOME/sdk/go1.19beta1
That's it.
Discussion