How to install multiple versions of go on mac m1

For instance, I want to try a new beta, go1.18beta2 (I check if it’s available on the download page). And I already have a regular go1.17, that I want to use as a default one.
To do so, I need to do this:

go install golang.org/dl/go1.18beta2@latest
go1.18beta2 download

Then I can check if it’s okay — go1.18beta2 version #go version go1.18beta2 darwin/arm64.
It is actually described on the official docs.
Then you can use it with goland by specifying /Users/bullgare/go/bin/go1.18beta2 or whatever which go1.18beta2 will return for you.
If you have amd64 architecture, you still can use GVM as it is the most convenient way to do so.

LEAVE A COMMENT