Giter Site home page Giter Site logo

theprocedural / go-version-manager Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 41.85 MB

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.

Home Page: https://gov.bjerkepedia.com

License: GNU General Public License v3.0

JavaScript 17.28% Shell 7.42% Go 57.98% HTML 17.32%
go golang version-management version-manager

go-version-manager's Introduction

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.

go-version-manager's People

Contributors

theprocedural avatar

Stargazers

 avatar

go-version-manager's Issues

Project-specific configs

gov can read a config file in the CWD to set the Go version. Perhaps it could be activated the same way as in NVM, i.e. gov use with no arguments.
Preferably, however, the Go version is "changed" automatically. I guess it could use a shell script for go, rather than the actual binary, which uses the CWD to determine the correct version of Go to run

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.