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

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
Comments
  • gobrew 1.7.3 under Linux (Ubuntu)

    gobrew 1.7.3 under Linux (Ubuntu)

    gobrew self-update

    Downloads the update and then produces the following error message: [Error] Cannot open file /home/paul/.gobrew/bin/gobrew: text file busy

    Happening on multiple linux machines and in Windows WSL

  • [bug] install via shell/go throws errors

    [bug] install via shell/go throws errors

    ~ ❯ curl -sLk https://git.io/gobrew | sh -                                                                                                                                                                   ✔ 2|0 at 10:49:22
    Using gobrew version latest
    
    Installed successfully to: /Users/jorde/.gobrew/bin/gobrew
    ============================
    : command not foundw/bin/gobrew: line 1:
    /Users/jorde/.gobrew/bin/gobrew: line 2: html: No such file or directory
    /Users/jorde/.gobrew/bin/gobrew: line 3: head: No such file or directory
    /Users/jorde/.gobrew/bin/gobrew: line 4: meta: No such file or directory
    /Users/jorde/.gobrew/bin/gobrew: line 5: title: No such file or directory
    /Users/jorde/.gobrew/bin/gobrew: line 5: middot: command not found
    /Users/jorde/.gobrew/bin/gobrew: line 5: /title: No such file or directory
    /Users/jorde/.gobrew/bin/gobrew: line 6: meta: No such file or directory
    /Users/jorde/.gobrew/bin/gobrew: line 7: style: No such file or directory
    /Users/jorde/.gobrew/bin/gobrew: line 8: body: command not found
    /Users/jorde/.gobrew/bin/gobrew: line 9: background-color:: command not found
    /Users/jorde/.gobrew/bin/gobrew: line 10: syntax error near unexpected token `('
    'Users/jorde/.gobrew/bin/gobrew: line 10: `        color: rgba(0, 0, 0, 0.5);
    ============================
    
    ***Please add PATH below to your ~/.bashrc manually***
    
    export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"
    

    Installation via Go works fine, but installs to the GOBIN path (default being $HOME/go/bin)

    Which results in gobrew being unable to run most commands as it expects the $HOME/.gobrew folder to be the correct directory.

    First time diving into Go, so maybe I'm missing something that's obvious to seasoned Go devs.

  •  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?

  • `gobrew self-update` may not work on M1/M2 macs

    `gobrew self-update` may not work on M1/M2 macs

    Since it replaces the binary, in order to install the new binary the old binary needs to be deleted completely.

    ╭─pulkit.kathuria@JP- ~/git/gobrew ‹master›
    ╰─$ gobrew self-update
    Downloading 100% |███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (5.6/5.6 MB, 9.119 MB/s)
    Upgrade successful
    ╭─pulkit.kathuria@JP- ~/git/gobrew ‹master›
    ╰─$ gobrew version
    [1]    57080 killed     gobrew version
    
  • Binary files on repository

    Binary files on repository

    #33

    ~/Projects/Github
     14:26:40  ❯ git clone [email protected]:kevincobain2000/gobrew.git
    Cloning into 'gobrew'...
    remote: Enumerating objects: 597, done.
    remote: Counting objects: 100% (223/223), done.
    remote: Compressing objects: 100% (105/105), done.
    remote: Total 597 (delta 109), reused 186 (delta 94), pack-reused 374
    Receiving objects: 100% (597/597), 270.40 MiB | 3.64 MiB/s, done.
    Resolving deltas: 100% (288/288), done.
    
    ~/Projects/Github
     14:28:03  ❯ du -sh gobrew
    311M	gobrew
    

    Repository contains binary files for all systems and all versions. In this time it 311M. Its a lot.

    We need to move binary files to Github Releases. And provide path for downloads binary files.

    Fo example we can download binary file from latest release:

    https://github.com/juev/starred/releases/latest/download/starred_0.0.5_Darwin_arm64.tar.gz
    

    We can use shell script with this function for download latest release, for example: https://gist.github.com/jpillora/5a7da6a297d2b6c33d04

    This example contains version in binary file. But we can provide files without it.

    Should we use tar for storing binary files? Good question. All operation systems contains tar. And we can use binary files with one name, and many tars with different names. For example, all executable files named as: gobrew, but tar archives as: gobrew-macos-64.tar.gz

    We can install manually from release page. Just download latest release, unpack it, move to PATH. But we can provide shell script, which can do it automatically. And we can create homebrew formula for installing gobrew on macOS. We have many options for it.

    For example: Hugo, contains many options for installation.

  • Allow specifying arch - especially for darwin

    Allow specifying arch - especially for darwin

    Having functionality to specify arch would be great to have. Sometimes projects might be dependent on x86_64 binaries Something like -

    $ gobrew install 1.19@darwin-amd64
    [Info] Downloading version: 1.19@darwin-amd64
    [Info] Downloading from: https://go.dev/dl/[email protected] # FAIL 
    [Info]: Downloading version failed: https://go.dev/dl/[email protected] returned status code 404
    [Error]: Please check connectivity to url: https://go.dev/dl/[email protected]
    
  • Can't install go1.14 on macOS

    Can't install go1.14 on macOS

    Hi.

    I have been trying to install go1.14 to work on a legacy project, but it seems gobrew can't install it in macOS Monterey 12.5.1 (M!).

    Please check the go1.19 in this log below, it is from system, but notice gobrew can't switch to go1.14 and remains allowing to install go1.14 two or more times:

    ~ % gobrew use 1.14
    [Info] Downloading version: 1.14
    [Info] Downloading from: https://golang.org/dl/go1.14.darwin-arm64.tar.gz
    [Info] Downloading to: ~/.gobrew/downloads
    Downloading 100% |████████████████████████████████████████████████████████████| (1.4/1.4 kB, 3.331 MB/s)
    [Info] Extracting from: ~/.gobrew/downloads/go1.14.darwin-arm64.tar.gz
    [Info] Extracting to: ~/.gobrew/versions/1.14
    [Success] Untar to ~/.gobrew/versions/1.14
    [Success] Downloaded version: 1.14
    [Info] Changing go version to: 1.14
    [Success] Changed go version to: 1.14
    
    ~ % go version
    go version go1.19 darwin/arm64
    
    ~ % gobrew use 1.14
    [Info] Downloading version: 1.14
    [Info] Downloading from: https://golang.org/dl/go1.14.darwin-arm64.tar.gz
    [Info] Downloading to: ~/.gobrew/downloads
    Downloading 100% |████████████████████████████████████████████████████████████| (1.4/1.4 kB, 3.476 MB/s)
    [Info] Extracting from: ~/.gobrew/downloads/go1.14.darwin-arm64.tar.gz
    [Info] Extracting to: ~/.gobrew/versions/1.14
    [Success] Untar to ~/.gobrew/versions/1.14
    [Success] Downloaded version: 1.14
    [Info] Changing go version to: 1.14
    [Success] Changed go version to: 1.14
    
    ~ % go version
    go version go1.19 darwin/arm64
    
    ~ % tree .gobrew
    .gobrew
    ├── current
    │   ├── bin -> ~/.gobrew/versions/1.14/go/bin
    │   └── go -> ~/.gobrew/versions/1.14/go
    └── versions
        └── 1.14
            └── unknown-pack
    
  • bug: index out of range

    bug: index out of range

    https://github.com/kevincobain2000/gobrew/runs/7720193596 https://github.com/kevincobain2000/gobrew/runs/7720193909

    Run gobrew use dev-latest
    [Info]: Fetching remote versions
    panic: runtime error: index out of range [-1]
    
    goroutine 1 [running]:
    github.com/kevincobain2000/gobrew.(*GoBrew).judgeVersion(0xc000020125?, {0x7ffeefbfecbb, 0xa})
    	/home/runner/work/gobrew/gobrew/gobrew.go:383 +0x7b4
    github.com/kevincobain2000/gobrew.(*GoBrew).Install(0xc00010fef0, {0x7ffeefbfecbb?, 0xc000020318?})
    	/home/runner/work/gobrew/gobrew/gobrew.go:317 +0x98
    main.main()
    	/home/runner/work/gobrew/gobrew/cmd/gobrew/main.go:60 +0xda
    Error:  Cannot unmarshal data: json: cannot unmarshal object into Go value of type []gobrew.Tag
    Error: Process completed with exit code 2.
    
  • 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.

  • 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

  • Feedback

    Feedback

    Sorry if this is not the best way to provide feedback.

    I've just installed this and its fantastic!

    Works perfectly and fast and is extremely useful.

    Thank you!

  • [feature request] command completion

    [feature request] command completion

    Hi.

    If possible, it would be useful to allow command completion to gobrew. This feature is present in many environment managers. Just as an example, by typing gobrew in, it would auto complete to gobrew install <cursor-here> by hit in TAB, and another hit in TAB would list the available versions.

Shell script to download and set GO environmental paths to allow multiple versions.
Shell script to download and set GO environmental paths to allow multiple versions.

gobrew gobrew lets you easily switch between multiple versions of go. It is based on rbenv and pyenv. Installation The automatic installer You can ins

Nov 3, 2022
Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions required!
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

Nov 21, 2022
Manage Go Versions/Projects/Dependencies
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

Dec 13, 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

Nov 14, 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

Nov 9, 2022
Dockpin - A tool for pinning Docker image and apt package versions

Dockpin Install dockpin with: go install github.com/Jille/dockpin@latest Dockpin

Dec 20, 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

Dec 14, 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

Oct 4, 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

Dec 14, 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

Oct 31, 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

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

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

Jan 28, 2022
Dotsync - Dotfiles manager without symlinks

dotsync dotfiles manager without symlinks Getting Started SYNOPSIS $ dotsync rep

Feb 12, 2022
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

Jan 2, 2023
Golangver - Go's distributives version manager

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

Sep 20, 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

Nov 30, 2021
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

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

Dec 27, 2021
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)
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

Oct 16, 2021