Code Monkey home page Code Monkey logo

goup's Introduction

๐Ÿš€ goup

Simple version manager like rustup or nvm but for Go.

Features

  • Install, manage and switch between different versions of the Go SDK.
  • Multi-shell compatible (Bash, Zsh, Nushell, Powershell)
  • Multi-platform compatible (Linux, macOS & Windows).
  • Tries to be as simple and "out-of-the-way" as possible.
  • Should be pretty fast.
  • Uses the precompiled binaries instead of compiling the sources locally.

Installation

Simply download the latest binaries from the Releases Page.

Alternatively, you can also install goup using cargo.

cargo install goup

If you want the latest unreleased version from the master branch, use the following command.

cargo install --git https://github.com/zekroTJA/goup

After that, run the following command to setup your environment to use goup to handle your Go versions.

goup env -p
source ~/.profile

This will add the required environment variables and $PATH extension to your .profile file.

Alternatively, if you just want to fiddle around with the tool, you can also just apply the environment to your current terminal session.

eval "$(goup env)"

How does it work?

goup uses the Go Repository on GitHub to query available versions using the git ls-remote --tags command (it is planned to add a fallback which uses the GitHub API when git is not available on the current system). This version list is then used to download selected versions from the official download server (https://go.dev/dl/). The downloaded SDKs are then directly un-zipped and un-packed while being downloaded into goup's worksapce directory, which is in the current users home directory at $HOME/.local/goup. All downloaded SDK versions are then stored in $HOME/.local/goup/installations. When selecting a specific installation version, the location in the installation directory is sym-linked to $HOME/.local/goup/current and the selected version is stored in the file $HOME/.local/goup/.current_version.

Using the command goup env -p, this will set the path of $HOME/.local/goup/current/go as your GOROOT environment variable and will add $HOME/.local/goup/current/go/bin to the beginning of your $PATH. This way, goup does not touch your local installation of Go and you cann roll back to before simply by removing the goup entries in your .profile and deleting the $HOME/.local/goup directory.

Credits

This tool is very much inspired by the both wonderful tools Schnitz' fnm and Rust's rustup.


ยฉ 2023 Ringo Hoffmann.
Covered by the MIT License.

goup's People

Contributors

zekrotja avatar cptpiepmatz avatar

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.