I want to manage version of Go. So I was thinking of using gvm, but gvm has some problems:
- gvm and gvm may conflict, because they have same name commands.
- gvm can't work on Windows. I'm Windows user.
Thus and so I created GoVM. This article will explain how to use GoVM.
$ python -c "import urllib2; print urllib2.urlopen('http://git.io/govm').read()" | python - setup
And append configuration for GoVM to your setting file. If you use linux, append to
.zshrc or etc:
export GOVM_ROOT=$HOME/.govm export PATH=$GOVM_ROOT/versions/current/bin:$PATH
Or, if you use windows, add
%USERPROFILE%\.govm as environment variable
Install Go with using GoVM
Installing Go requires some tools. See also http://golang.org/doc/install.
You had installed this tools, and run GoVM to install Go:
$ govm install go1.3
go1.3 is currently latest version of Go. If you feel this version is older, you can replace it.
Finish the command, you select to use the version of Go:
$ govm use go1.3
test of installed:
$ go version go version go1.3 ...
And install other version Go
You want to use
go1.2.1 is currently version of GAE SDK's Go). Run to install:
$ govm install go1.2.1
And select to use
$ govm use go1.2.1 $ go version go version go1.2.1 ...
If you need to use
go1.3 again, select to use too:
$ govm use go1.3 $ go version go version go1.3
Wonderful! Now, you got the version
go1.3 and you can select to use version of Go freely.
How change the version of Go according to directory like
.ruby-version with rbenv?
GoVM dosen't support and aren't going to support a such function. You should use direnv. direnv is usuful!
Thank you for reading!