Git Product home page Git Product logo

oo's Introduction

OO - Go Version Manager

Latest version: 0.0.5

oo was heavily inspired by tj/n.

Install

  1. Clone this repo.

  2. Add this to your bashrc or zshrc:

    source "/path/to/oo/env"

Note that you need to set GOPATH manually in your bashrc or zshrc:

export GOPATH=/path/to/your/gopath
export PATH=$PATH:$GOPATH/bin

Examples

Get go1.4 installed:

$ oo get 1.4

Use go1.4 as current go (or just oo 1.4):

$ oo use 1.4
=> go1.4

Run go from 1.3 temporary:

$ oo as 1.3 version
go version go1.3 darwin/amd64
$ oo as 1.3 run helloworld.go
Hello world!

List all installed go versions

$ oo ls

Build (or rebuild) go by version:

$ oo build 1.4
build go1.4..
build successfully

Get current go binary path:

$ oo bin
/Users/hit9/github/oo/go/bin/go

Remove a version:

$ oo rm 1.5rc1                                                                                                                                                                          1 ↵ (go1.4 [email protected]) ~/github/oo/versions/1.5/src
[email protected] removed

Usage

Usage: oo [COMMAND]

Commands:
  oo                         Output current go version
  oo ls                      Output versions installed
  oo <version>               Use go <version>
  oo use <version>           Use go <version>
  oo get <version>           Get go <version>
  oo rm <version>            Remove the given version
  oo as <version>            Run go from oo on a specific version
  oo dir [<version>]         Show go directory by version
  oo bin [<version>]         Show go binary path by version
  oo build [<version>]       Build go by version
  oo env                     Output current go env
  oo upgrade                 Upgrade oo to latest version

Options:
  -v, --version              Output oo's version
  -h, --help                 Output this help message

Environment Variables:
  OO_MIRROR_PATTERN          Mirror url pattern to download go source tarball
                             default: https://codeload.github.com/golang/go/tar.gz/go%s
  OO_BUILD_CMD               Command to build go from source, default: ./make.bash
  OO_BOOTSTRAP_VERSION       Bootstrap go version to compile the target version,
                             default: the latest installed version

Version: 0.0.4

Custom Mirror

$ export OO_MIRROR_PATTERN='https://storage.googleapis.com/golang/go%s.src.tar.gz'
$ oo get 1.4
get https://storage.googleapis.com/golang/go1.4.src.tar.gz..
##########                                                                14.4%

Similar Projects

Troubles

Build golang from source may fail in many different reasons (such as bootstrap failures), please download latest binary archive tarball from golang.org once any trouble occurrs during build, and use that binary to bootstrap your golang source inside oo directory manually, then oo is ready to use again.

cd path/to/oo/versions/x.x.x/src
GOROOT_BOOTSTRAP=path/to/downloaded/go ./all.bash

License

MIT.

oo's People

Contributors

hit9 avatar

Watchers

 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.