Go Version Manager (gov)
Go Version Manager (gov) is a simple command-line tool for managing Go versions on your system.
Table of contents
- Compiling from Source
Linux and macOS
Using curl (recommended):
curl -fsSL https://gov.theprocedural.com/gov.sh | bash
wget -O- https://gov.theprocedural.com/gov.sh | bash
List available supported Go versions
List all available Go versions
Install a Go version
Install a Go version, or the latest release using the "latest" tag, e.g:
gov install 1.21.1
gov install latest
gov i 1.21.1
gov i latest
Reinstall a Go version
Remove and then install again a Go version, e.g:
gov reinstall 1.21.1
gov r 1.21.1
Use a Go version
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.
gov use 1.21.1
gov u 1.21.1
Display the currently used Go version
List installed Go versions
Remove a Go version
gov remove 1.21.1
gov x 1.21.1
Remove all installed Go versions except the currently used one, e.g:
Show the installed gov version and extras.
Update gov to its latest version
This will only remove gov, not your installed Go versions.
After uninstallation, gov will provide instructions to remove Go and leftovers.
# or make a mistake ¯\_(ツ)_/¯
Compiling from Source
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:
Build gov using the build scripts:
Make script executable (if needed)
sudo chmod +x ./build.sh
Build only the supported platforms (recommended)
Build for every platform and architecture. I mean, why not?
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.