GithubHelp home page GithubHelp logo

devnw / gvm Goto Github PK

View Code? Open in Web Editor NEW
55.0 1.0 4.0 136 KB

Go Version Manager (gvm) enables seamless installing and swapping between Go versions with a single command. This tool manages a Go environment for the user by allowing a user to specify which Go version they wish to use and handling all of the steps to install and configure that Go version. GVM also supports installing Go from the official Golang master branch so that you can easily try the next version of Go without waiting for a pre release build.

License: Apache License 2.0

Shell 100.00%
golang go version-manager installer package-manager go-installer google-golang google-go gvm

gvm's Introduction

gvm

Go Version Manager

ShellCheck lint License: Apache 2.0 PRs Welcome

Install

curl -o- https://raw.githubusercontent.com/devnw/gvm/main/install.sh | bash
wget -qO- https://raw.githubusercontent.com/devnw/gvm/main/install.sh | bash

Updating gvm

gvm will automatically detect if there is a newer version available for the installed gvm tag and give the user the option to update (NOTE This does NOT work for semver tags). If the user chooses to update, the gvm command will be updated to the latest version and re-run the updated script instead.

Usage

gvm <command> [arguments]

Available Commands

<go version> Install or Change Specific Go Version

  • -s Silent Mode (No Prompts)

  • -r Remove Go Version

ls List Installed Go Versions

clean Remove inactive Go Versions

-h | --help | help Print this help text

Installation Example

To install a released version of Go use the following command.

gvm 1.17.5

If this version of Go has been previously installed, the link will be updated activating that version. If the version is not installed however gvm will install it, then link it.

To remove a version

gvm 1.17.5 -r

Development Version

gvm supports installing the current development version of Go

To install the current development version of Go use the following command.

gvm next

NOTE: If you have previously installed the development version of Go you must pass the --update flag if you want to build the latest development version, otherwise it will keep using the previously compiled development version.

How it works

gvm creates a directory at $HOME/.gvm and stores all of the Go versions in it. It then creates a symlink to the currently active version at $HOME/.gvm/go which is then added to the beginning of the PATH.

Supported OSes and Architectures

  • Linux (ARM64 / AMD64)
  • Mac OS X (ARM64 / AMD64)
  • FreeBSD (ARM64 / AMD64)

gvm's People

Contributors

benjivesterby avatar dependabot[bot] avatar jdaniel-cpts avatar maracko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gvm's Issues

[Feat]: GitHub Support

Is your feature request related to a problem? Please describe.
Support for Github on Windows

Describe the solution you'd like
GVM support for GitHub on Windows OS. I've attached an updated version of the gvm file that includes additional lines necessary for the support. Wasn't sure if you would allow a pull request or not so please see file

Describe alternatives you've considered
Possibly using embedded linux on windows but Gitbash works and is a much lighter solution. We've been using it to develop golang for many years.

Additional context
Here is an output of gvm running against gitbash on windows using the attached version of the file. Notice its successfully downloading zip version of amd64

image

gvm.txt

Update auto-update release documentation

Currently the README indicates that the auto-update feature works for any tagged version of gvm. This is not the case.

The documentation needs to be updated to indicate that the auto-release ONLY works for latest and dev tags as those are the ones that are updated as part of the release process and will cause the sha 256 mismatch which alters the script to alterations. For v*.. tags those never get updated and so the sha will never differ since we will not push new updates to existing tags that are v*..

gvm fails in latest build

Hey, this seems like a really cool project to replace my bash script used to update go.

However after a clean install I get a syntax error as shown in the picture below:

image

Test on freebsd

Determine if current latest runs properly on freebsd

Correct any issues found and update documentation to show freebsd as supported

[Feat]: Add persistent configuration

This should allow for a users selection on prompts to be remembered from previous runs to allow for a completely silent run on subsequent executions.

Test on Windows WSL 2

Determine if this runs properly on WSL 2 running ubuntu.

Correct issues if it doesn't and update documentation to list as supported.

Add support for forks

Add an option for a user to use a fork in place of the go git repo path to build their own development branch as part of the go next command. Perhaps go next --fork <github-path>

[Feat]: Automatically re-build `gopls`

This should intelligently re-build gopls as needed based on the users current active version to enable language support for their editor. Note: Only update gopls if it is already installed.

[Feat]: Update readme for windows docs

Pull docs update from PR for the windows changes. Be sure to include the must install gitbash with symlinks and source ~/.bashrc and how to create the ~/.bashrc file for path

vi ~/.bashrc
export PATH=$PATH:"/c/Users/<username>/bin"
exit gitbash and reopen
error at top may say a `.bash_profile` was created for you
curl command from docs
source ~/.bashrc
gvm <version>
``

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.