For the reason here, you should follow the steps below before installing the first GO version with GVM;
- Download latest GO version as archive from here.
- Extract archive.
- Execute this command in terminal to add GO path temporarily;
export PATH="$PATH:/Users/cagrialdemir/Desktop/go/bin"
- Install latest GO version with GVM;
gvm install go1.19.2
- Use downloaded GO and set it as default;
gvm use go1.19.2 --default
- Now, you can delete temporarily downloaded GO folder;
rm -rf /Users/cagrialdemir/Desktop/go
- Download the wanted GO version as archive.
- Extract into
~/.gvm/gos/
and rename extracted folder asgo<version-number>
- Create a file in
~/.gvm/environments/
and just copy the file for a different version and change the version numbers in the file. - Create an empty directory named
go<version-number>
in the~/.gvm/pkgsets/
path. - Now, you can use the version with
gvm use go<version-number>