Install go, yay!
gimme
is a shell script that knows how to install go. Fancy! 🎉
Install from github:
# assumes ~/bin exists and is in $PATH, so adjust accordingly!
curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
chmod +x ~/bin/gimme
Homebrew (OS X):
brew install gimme
Then check the help text a la:
gimme -h
# or
gimme --help
# or
gimme help
# or
gimme wat
To install and use version 1.4, for example:
eval "$(GIMME_GO_VERSION=1.4 gimme)"
# or:
eval "$(gimme 1.4)"
# or if you can't stand the thought of using `eval`:
gimme 1.4
source ~/.gimme/envs/go1.4.env
Or run without installing gimme:
eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)"
To list installed versions of Go:
gimme -l
# or
gimme --list
# or
gimme list
To force re-installation of an existing Go version:
gimme --force 1.4.1
# or
gimme -f 1.4.1
# or even
gimme force 1.4.1
To get the version of gimme:
gimme -V
# or
gimme --version
# or even
gimme version
The original goal of this project was trivial cross-compilation within Travis. The following is an example .travis.yml
file to accomplish this for a normal Go project:
language: go
env:
- GIMME_OS=linux GIMME_ARCH=amd64
- GIMME_OS=darwin GIMME_ARCH=amd64
- GIMME_OS=windows GIMME_ARCH=amd64
install:
- go get -d -v ./...
script:
- go build -v ./...