gvmを試す
たぶんrubyのrvm、pythonのvirtualenvみたいなもの。
インストール
$ bash < <(curl -s https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer) Created profile for existing install of Go at /usr/local/go Installed GVM v1.0.19 Please restart your terminal session or to get started right away run `source $HOME/.gvm/scripts/gvm`
使ってみる
ヘルプ
$ gvm Usage: gvm [command] Description: GVM is the Go Version Manager Commands: version - print the gvm version number get - gets the latest code (for debugging) use - select a go version to use diff - view changes to Go root implode - completely remove gvm install - install go versions uninstall - uninstall go versions cross - install go cross compilers linkthis - link this directory into GOPATH list - list installed go versions listall - list available versions alias - manage go version aliases pkgset - manage go packages sets pkgenv - edit the environment for a package set
インストール可能なgoの一覧
$ gvm listall gvm gos (available) go1 go1.0.1 go1.0.2 go1.0.3 go1.1 go1.1.1 go1.1.2 go1.1rc2 go1.1rc3 go1.2 go1.2rc2 go1.2rc3 go1.2rc4 go1.2rc5 release release.r56 release.r57 release.r57.1 release.r57.2 release.r58 release.r58.1 release.r58.2 release.r59 release.r60 release.r60.1 release.r60.2 release.r60.3
インストール
$ gvm install go1.2 Downloading Go source... Installing go1.2... * Compiling...
インストール済みの一覧
もともとインストールされていたgoが"system"
$ gvm list gvm gos (installed) go1.2 => system
使用するgoを変更
$ gvm use go1.2 Now using version go1.2
pkgset
$ gvm pkgset = gvm pkgset * http://github.com/moovweb/gvm == DESCRIPTION: GVM pkgset is used to manage various Go packages == Usage gvm pkgset Command == Command create - create a new package set delete - delete a package set use - select where gb and goinstall target and link empty - remove all code and compiled binaries from package set list - list installed go packages
pkgsetを作成、選択
$ gvm pkgset create sandbox $ gvm pkgset list gvm go package sets (go1.2) => global sandbox $ gvm pkgset use sandbox Now using version go1.2@sandbox
使用感は記憶にあるrvmとだいたい同じ