$ sudo apt-get install golang
$ sudo apt-get install curl git mercurial make binutils bison gcc build-essential
$ bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
if [ -s ${HOME}/.gvm/scripts/gvm ]; then source ${HOME}/.gvm/scripts/gvm fi
$ gvm install go1.4.2 $ gvm use go1.4.2 $ gvm install go1.5
'unknown relocation type 42; compiled without -fpic?
') になる場合は、環境変数 ('export CGO_ENABLED=0
') を宣言しておくといいようだ。$ gvm use go1.4.2 $ gvm cross OS ARCH
$ gvm use GO
$ gvm listall
$ gvm list
$ gvm use GO --default
$ sudo tar -C /usr/local -xzf go1.4.x.linux-amd64.tar.gz
$ cd /usr/local/go/src $ sudo ./all.bash
export GOROOT=/usr/local/go export PATH=$PATH:$GOROOT/bin
$ cd /usr/local $ sudo mv /usr/local/go /usr/local/go1.4
$ sudo tar -C /usr/local -xzf go1.5.x.linux-amd64.tar.gz
$ export GOROOT_BOOTSTRAP=/usr/loca/go1.4 $ cd /usr/local/go/src $ sudo -E ./all.bash
export GOROOT_BOOTSTRAP=/usr/loca/go1.4
$ go version
$ go run SOURCE.go
$ go build SOURCE.go
$ GOOS=OS名 GOARCH=アーキテクチャ go build SOURCE.go
$ GOOS=windows GOARCH=amd64 go build SOURCE.go
$ ./SOURCE