Go version manager. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.

Overview

gobrew

Go version manager

Install or update

With curl

$ curl -sLk https://git.io/gobrew | sh -

or with go

$ go get -u github.com/kevincobain2000/gobrew/cmd/gobrew

Add GOPATH & PATH setting your shell config file (.bashrc or .zshrc).

export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"

Reload config.

All DONE!

(optional)

export GOPATH="$HOME/go"
## or set for version specific
export GOPATH="$HOME/.gobrew/current/go"

Confirm

$ gobrew help

Usage

Will install and set Go

$ gobrew use 1.16

Will only install it and then use it

$ gobrew install 1.16
$ gobrew use 1.16

Uninstall a version

$ gobrew uninstall 1.16

List installed versions

$ gobrew ls

1.15.8
1.16*

current: 1.16

List available versions

$ gobrew ls-remote

...
1.15.1
1.15.2
1.15.3
1.15.4
1.15.5
1.15.6
1.15.7
1.15.8
...
1.16
1.16beta1
1.16rc1

All commands

$ gobrew help                         Show this message
$ gobrew use <version>                Use <version>
$ gobrew install <version>            Download and install <version> (from binary))
$ gobrew uninstall <version>          Uninstall <version>
$ gobrew list                         List installed versions
$ gobrew ls                           Alias for list
$ gobrew ls-remote                    List remote versions
Issues
  •  Downloading version failed: file too large

    Downloading version failed: file too large

    While installing go, getting following error in mocos:

    ❯ gobrew install 1.16 [Info] Downloading version: 1.16 [Info]: Downloading version failed: write /Users/mayank/.gobrew/downloads/go1.16.darwin-amd64.tar.gz: file too large [Error]: Please check connectivity to url: https://golang.org/dl/go1.16.darwin-amd64.tar.gz

    I can download the version via browser without any issue. Any tips on how to bypass this limit?

    opened by maknahar 9
  • Registry Path needs to be updated to use correct path.

    Registry Path needs to be updated to use correct path.

    image

    Issue is current path registryPath of https://golang.org/dl/ does not finish downloading as it fails due to incorrect path to the install package. Path needs to be updated to use https://go.dev/dl/ which is the updated path for downloading a version.

    Does not install the correct windows package.

    opened by tlor-cpts 5
  • issue - gobrew not installing go binary

    issue - gobrew not installing go binary

    Hi there,

    Thanks so much for putting this project together. I'm really excited to use it. I'm currently having an issue where it seems like gobrew will not actually download the binary for any version of go. I've attached a screen recording below. I installed via curl and am using an Ubuntu 20.04 LTS Linux system. I made sure to update my $PATH

    Any ideas? Thanks!

    https://user-images.githubusercontent.com/36898266/145304458-fe3f9ad9-896e-48f5-87e6-650e518bf06f.mp4

    opened by wdfinch 4
  • Best path for GOROOT

    Best path for GOROOT

    Hi sorry, there I'm a go noob. I'm installed go using gobrew and my IDE is complaining because I don't have GOROOT set. What should I set it to with this install method? Maybe some info on this could be added to the docs?

    opened by wdfinch 2
  • Fix binary name for mac m1

    Fix binary name for mac m1

    HI @kevincobain2000, thank you for a quick merge of my previous PR. Unfortunately, it was too quick and I had a small problem in it. The binary name has a mismatch in the build file and the file to download it. This PR fixes it.

    Ref: https://github.com/kevincobain2000/gobrew/pull/21

    opened by alexdashkov 2
  • ls-remote lists versions lexicographically and duplicates the list

    ls-remote lists versions lexicographically and duplicates the list

    Hey pretty cool project. Wanted to contribute by nitpicking a little bit 😄

    image

    As you can see here ls-remote result is duplicated and the version numbers are listed lexicographically. Ordering of the patch releases is not important but minor releases should be ordered according the numerical/semantic/release order.

    opened by Akaame 2
  • Trying to use older version such as 1.13 dont work

    Trying to use older version such as 1.13 dont work

    Hello,

    Recently downloaded your tool with the hopes of back testing my app on older versions of GO. But it doesn't appear to be working on and version below 1.16

    willfawthrop — zsh (figterm) ▸ zsh — 80×24 2022-06-20 08-14-27

    opened by cas8180 1
  • gobrew ls-remote lists package x.x.0 versions wrongly

    gobrew ls-remote lists package x.x.0 versions wrongly

    Just wanted to testdrive the new go 1.18 this morning and stumbled across a little bug in gobrew: the first "minor" versions include the .0 suffix. That's not how they are listed on https://go.dev/dl/ however. There the "patch" version is omitted for the .0 releases.

    gobrew install 1.18.0
    [Info] Downloading version: 1.18.0
    [Info] Downloading from: https://golang.org/dl/go1.18.0.darwin-arm64.tar.gz
    [Error]: Response status code: 404
    [Info]: Please wait for the file to download.
    [Success] Untar to /Users/holger/.gobrew/versions/1.18.0
    [Info]: Untar failed: exit status 1
    [Error]: Please check if version exists from url: https://golang.org/dl/go1.18.0.darwin-arm64.tar.gz
    

    vs

    gobrew install 1.18
    [Info] Downloading version: 1.18
    [Info] Downloading from: https://golang.org/dl/go1.18.darwin-arm64.tar.gz
    [Success]: Response status code: 200
    [Success] Untar to /Users/holger/.gobrew/versions/1.18
    [Success] Downloaded version: 1.18
    
    opened by the-holger 1
  • Version not found

    Version not found

    $ gobrew ls-remote
    [Info]: Fetching remote versions
    1       1.0.1  1.0.2  1.0.3  
    1.1     1.1.0  1.1.1  1.1.2  
    1.2     1.2.0  1.2.1  1.2.2  
    1.3     1.3.0  1.3.1  1.3.2  1.3.3  
    1.4     1.4.0  1.4.1  1.4.2  1.4.3  
    1.5     1.5.0  1.5.1  1.5.2  1.5.3  1.5.4  
    1.6     1.6.0  1.6.1  1.6.2  1.6.3  1.6.4  
    1.7     1.7.0  1.7.1  1.7.2  1.7.3  1.7.4  1.7.5  1.7.6  
    1.8     1.8.0  1.8.1  1.8.2  1.8.3  1.8.4  1.8.5  1.8.6  1.8.7  
    1.9     1.9.0  1.9.1  1.9.2  1.9.3  1.9.4  1.9.5  1.9.6  1.9.7  
    1.10    1.10.0  1.10.1  1.10.2  1.10.3  1.10.4  1.10.5  1.10.6  1.10.7  1.10.8  
    1.11    1.11.0  1.11.1  1.11.2  1.11.3  1.11.4  1.11.5  1.11.6  1.11.7  1.11.8  1.11.9  1.11.10  1.11.11  1.11.12  1.11.13  
    1.12    1.12.0  1.12.1  1.12.2  1.12.3  1.12.4  1.12.5  1.12.6  1.12.7  1.12.8  1.12.9  1.12.10  1.12.11  1.12.12  1.12.13  1.12.14  1.12.15  1.12.16  1.12.17  
    1.13    1.13.0  1.13.1  1.13.2  1.13.3  1.13.4  1.13.5  1.13.6  1.13.7  1.13.8  1.13.9  1.13.10  1.13.11  1.13.12  1.13.13  1.13.14  1.13.15  
    1.14    1.14.0  1.14.1  1.14.2  1.14.3  1.14.4  1.14.5  1.14.6  1.14.7  1.14.8  1.14.9  1.14.10  1.14.11  1.14.12  1.14.13  1.14.14  1.14.15  
    1.15    1.15.0  1.15.1  1.15.2  1.15.3  1.15.4  1.15.5  1.15.6  1.15.7  1.15.8  1.15.9  1.15.10  1.15.11  1.15.12  1.15.13  1.15.14  1.15.15  
    1.16    1.16.0  1.16.1  1.16.2  1.16.3  1.16.4  1.16.5  1.16.6  1.16.7  
    1.17
    $ gobrew install 1.16.7
    [Info] Downloading version: 1.16.7 
    [Success] Untar to /home/miguel/.gobrew/versions/1.16.7
    [Info]: Untar failed: exit status 2 
    [Error]: Please check if version exists from url: https://golang.org/dl/go1.16.7.linux-amd64.tar.gz
    

    First I need to thank you for such a simple version manager. I could never understand why people wouldn't use golang to build a version manager to itself. Instead, most alternatives use bash scripts for some reason :thinking: .

    As the time of writing, the url https://golang.org/dl/go1.16.7.linux-amd64.tar.gz returns 404 but the release does exist in Github. Any reason why not to use Github releases? Cheers!

    opened by migueleliasweb 1
  • bash syntax is incompatible with sh

    bash syntax is incompatible with sh

    Steps to reproduce

    1. Install with curl -sLk https://git.io/gobrew | sh -

    Expected

    Installed successfully
    

    Actual

    sh: 7: [[: not found
    sh: 9: [[: not found
    sh: 11: [[: not found
    sh: 13: [[: not found
    Installed successfully
    

    Possible fix

    [[, ]] and == are bash specific and not compatible with sh.
    This can be fixed by specifying bash in the shebang #!/bin/bash but that would reduce portability. Some POSIX compatible command alternatives are: |Bash|POSIX| |---|---| |[[ and ]]|[ and ]| |==|=| |$OSTYPE|uname -o|

    Bash regex:

    if [[ "$OSTYPE" == "linux-gnu"* ]]; then
      GOBREW_ARCH_BIN="gobrew-linux-64"
    

    POSIX case statement with glob patterns:

    case $(uname -o) in
      GNU/Linux*)
        GOBREW_ARCH_BIN='gobrew-linux-64';;
    

    Also consider invoking sh like this: sh -c "$(curl -fsSL https://git.io/gobrew)"

    opened by ojwm 1
  • override registryPath from user

    override registryPath from user

    When inside restricted networks like inside enterprise, the 'golang.org' may not be accessible, so there's a need to override the registryPath like from env.

    opened by futurist 0
Releases(v1.5.9)
Bump-version - Bump a given semantic version, following a given version fragment

bump-version Bump a given semantic version, following a given version fragment.

Weslei Juan Novaes Pereira 3 Feb 7, 2022
Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions required!

A cross-platform package manager for the web! Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions

Andrew Lee 22 May 26, 2022
Manage Go Versions/Projects/Dependencies

rodent rodent is a shell (bash) application which: Manages multiple versions of Go. Allows you to test/build your projects against multiple Go release

Ali Abbas 32 May 31, 2022
Stop using install.sh! Start using install.yml! DAJE...

Daje - A general purpose Ansible dotfiles installer Configure one time and run everywhere. What is this I've never liked using a big bash script to in

Schrödinger Hat 18 May 17, 2022
Google Compute Engine (GCE) VM takeover via DHCP flood - gain root access by getting SSH keys added by google_guest_agent

Abstract This is an advisory about an unpatched vulnerability (at time of publishing this repo, 2021-06-25) affecting virtual machines in Google's Com

null 511 Jun 29, 2022
Dockpin - A tool for pinning Docker image and apt package versions

Dockpin Install dockpin with: go install github.com/Jille/[email protected] Dockpin

Jille Timmermans 8 Jun 12, 2022
operator to install cluster manager and klusterlet.

registration-operator Minimum cluster registration and work Community, discussion, contribution, and support Check the CONTRIBUTING Doc for how to con

Open Cluster Management 48 Jun 21, 2022
A tool that scans archives to check for vulnerable log4j versions

log4j-sniffer log4j-sniffer crawls for all instances of log4j that are earlier t

Palantir Technologies 185 Jun 13, 2022
The missing package manager for golang binaries (its homebrew for "go install")

Bingo: The missing package manager for golang binaries (its homebrew for "go install") Do you love the simplicity of being able to download & compile

TekWizely 175 May 29, 2022
Super simple deployment tool

Dropship Dropship is a simple tool for installing and updating artifacts from a CDN. Features Automatically performs md5sum checks of artifact that is

Christopher McKenzie 59 Jun 10, 2022
Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behaviors.

add-operator Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behavio

Dinesh Parvathaneni 0 Dec 15, 2021
Seatsserver - Combined frontend and backend to serve HTML versions of seats

seatsserver Combined frontend and backend to serve HTML versions of github.com/s

Jeff Palm 0 Jan 28, 2022
Dotsync - Dotfiles manager without symlinks

dotsync dotfiles manager without symlinks Getting Started SYNOPSIS $ dotsync rep

KADOTA, Kyohei 1 Feb 12, 2022
Terraform Provider for Latest HashiCorp Product Versions

terraform-provider-hashicorpversions The purpose of this Terraform provider is to get the latest semantic version of any of the suite of HashiCorp too

Justin DeFrank 3 May 16, 2022
Output all versions of a local git repo, which could be used as test data for your ML program.

gitwalker Output all versions of a local git repo, which could be used as test data for your ML program. Notice This program is under development. Cur

zhuaiballl 0 Dec 27, 2021
Go Version Manager

gvm By Josh Bussdieker (jbuss, jaja, jbussdieker) while working at Moovweb Currently lovingly maintained by Benjamin Knigge Pull requests and other an

Moovweb 7.5k Jul 3, 2022
Golangver - Go's distributives version manager

golangver Go's distributive version manager (knitted myself with love :) Require

Alexander Orlovsky 2 Feb 7, 2022
A super simple demo to document my journey to reasonably sized docker containers.

hello-docker A super simple demo to document my journey to reasonably sized docker containers. Task at Hand Build a docker container as small as possi

Torsten Wunderlich 0 Nov 30, 2021
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)

Terraform Provider for Azure (Resource Manager) Version 2.x of the AzureRM Provider requires Terraform 0.12.x and later, but 1.0 is recommended. Terra

null 0 Oct 16, 2021