gobrew

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 12 Imported by: 0

README

gobrew

Go version manager

Install or update

With curl

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

or install using 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

Screenshots

colors-ls-remote colors-install

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	ListVersions()
	ListRemoteVersions()
	CurrentVersion() string
	Uninstall(version string)
	Install(version string)
	Use(version string)
	Helper
}

Command ...

type GoBrew

type GoBrew struct {
	Command
	// contains filtered or unexported fields
}

GoBrew struct

func NewGoBrew

func NewGoBrew() GoBrew

NewGoBrew instance

func (*GoBrew) CurrentVersion

func (gb *GoBrew) CurrentVersion() string

CurrentVersion get current version from symb link

func (*GoBrew) Install

func (gb *GoBrew) Install(version string)

Install the given version of go

func (*GoBrew) ListRemoteVersions

func (gb *GoBrew) ListRemoteVersions()

ListRemoteVersions that are installed by dir ls

func (*GoBrew) ListVersions

func (gb *GoBrew) ListVersions()

ListVersions that are installed by dir ls highlight the version that is currently symbolic linked

func (*GoBrew) Uninstall

func (gb *GoBrew) Uninstall(version string)

Uninstall the given version of go

func (*GoBrew) Use

func (gb *GoBrew) Use(version string)

Use a version

type Helper

type Helper interface {
	// contains filtered or unexported methods
}

Helper ...

Directories

Path Synopsis
cmd
gobrew command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL