Skip to content

TheProcedural/go-version-manager

Repository files navigation

Go Version Manager (gov)

Go Version Manager (gov) is a simple command-line tool for managing Go versions on your system.

Table of contents

Installation

Linux and macOS

Using curl (recommended):

curl -fsSL https://gov.theprocedural.com/gov.sh | bash

Using wget:

wget -O- https://gov.theprocedural.com/gov.sh | bash

Usage

List available supported Go versions

Long:

gov list-supported

Short:

gov s

List all available Go versions

Long:

gov list-all

Short:

gov a

Install a Go version

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

Reinstall a Go version

Remove and then install again a Go version, e.g:

Long:

gov reinstall 1.21.1

Short:

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.

Long:

gov use 1.21.1

Short:

gov u 1.21.1

Display the currently used Go version

Long:

gov current

Short:

gov c

List installed Go versions

Long:

gov list

Short:

gov l

Remove a Go version

Long:

gov remove 1.21.1

Short:

gov x 1.21.1

Prune

Remove all installed Go versions except the currently used one, e.g:

Long:

gov prune

Short:

gov p

Show version

Show the installed gov version and extras.

Long:

gov version

Short:

gov v

Self update

Update gov to its latest version

Long:

gov self-update

Short:

gov e

Uninstall gov

This will only remove gov, not your installed Go versions.

After uninstallation, gov will provide instructions to remove Go and leftovers.

gov sayonara

Show help

gov --help
gov -h
gov help
gov h
# or make a mistake ¯\_(ツ)_/¯

Compiling from Source

If you prefer to compile gov from source or want to contribute, you can follow these steps:

  1. Clone the gov repository:

    git clone https://gitlab.com/TheProcedural/go-version-manager
  2. Change to the gov directory:

    cd gov
  3. Build gov using the build scripts:

    1. Make script executable (if needed)

      sudo chmod +x ./build.sh
    2. Build only the supported platforms (recommended)

      ./build.sh <new_gov_version>
    3. Build for every platform and architecture. I mean, why not?

      ./build-all.sh <new_gov_version>
  4. Optionally, move the gov binary to a directory included in your system's PATH for easy access.

Building notes

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.

License

This project is licensed under the GPLv3 License - see the LICENSE file for details.

Copyright notice

Copyright (c) 2023 Erik Bjerke. All rights reserved.

This software is not affiliated with or endorsed by the Go Project.

About

Go Version Manager (gov) is a simple command-line tool for managing Go versions on your system. You can get started by running the following command in your terminal.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published