Go Version Manager (gov) is a simple command-line tool for managing Go versions on your system.
Using curl (recommended):
curl -fsSL https://gov.theprocedural.com/gov.sh | bash
Using wget:
wget -O- https://gov.theprocedural.com/gov.sh | bash
Long:
gov list-supported
Short:
gov s
Long:
gov list-all
Short:
gov a
Install a Go version, or the latest release using the "latest" tag, e.g:
Long:
gov install 1.21.1
gov install latest
Short:
gov i 1.21.1
gov i latest
Remove and then install again a Go version, e.g:
Long:
gov reinstall 1.21.1
Short:
gov r 1.21.1
The first time gov will set the env var for you and you might need to restart your shell/terminal for the configuration to take effect. Subsequent changes should work seamlessly.
Long:
gov use 1.21.1
Short:
gov u 1.21.1
Long:
gov current
Short:
gov c
Long:
gov list
Short:
gov l
Long:
gov remove 1.21.1
Short:
gov x 1.21.1
Remove all installed Go versions except the currently used one, e.g:
Long:
gov prune
Short:
gov p
Show the installed gov version and extras.
Long:
gov version
Short:
gov v
Update gov to its latest version
Long:
gov self-update
Short:
gov e
This will only remove gov, not your installed Go versions.
After uninstallation, gov will provide instructions to remove Go and leftovers.
gov sayonara
gov --help
gov -h
gov help
gov h
# or make a mistake ¯\_(ツ)_/¯
If you prefer to compile gov from source or want to contribute, you can follow these steps:
-
Clone the gov repository:
git clone https://gitlab.com/TheProcedural/go-version-manager
-
Change to the gov directory:
cd gov
-
Build gov using the build scripts:
-
Make script executable (if needed)
sudo chmod +x ./build.sh
-
Build only the supported platforms (recommended)
./build.sh <new_gov_version>
-
Build for every platform and architecture. I mean, why not?
./build-all.sh <new_gov_version>
-
-
Optionally, move the gov binary to a directory included in your system's PATH for easy access.
If you build for Windows note that env vars and zip extraction won't work. You're welcome to work on Windows support. I just can't be arsed with Windows, it puts me in a bad mood every time I use it.
This project is licensed under the GPLv3 License - see the LICENSE file for details.
Copyright (c) 2023 Erik Bjerke. All rights reserved.
This software is not affiliated with or endorsed by the Go Project.