The go get
command is useful. But we want to fix the problem where package versions are different from the latest update.
Are you going to do go get -tags=1.1 ...
, go get -tag=0.3
for each of them? We want to freeze package version.
Ruby's bundle is awesome.
go get github.com/mattn/gom
gom 'github.com/mattn/go-runewidth', :tag => 'go1'
gom 'github.com/mattn/go-scan', :commit => 'ecb144fb1f2848a24ebfdadf8e64380406d87206'
gom 'github.com/daviddengcn/go-colortext'
gom 'github.com/mattn/go-ole', :goos => 'windows'
Create _vendor directory and bundle packages into it
gom install
Build on current directory with _vendor packages
gom build
Run tests on current directory with _vendor packages
gom test
Generate .travis.yml that uses gom test
gom gen travis-yml
You can always change the name relative to the current $GOPATH
directory using an environment variable: GOM_VENDOR_NAME
$ # to use a regular $GOPATH/src folder you should specify GOM_VENDOR_NAME equal '.'
$ GOM_VENDOR_NAME=. gom <command>
Writing Gomfile and bundle
$ ls
main.go
$ gom gen gomfile
$ cat Gomfile
gom 'github.com/daviddengcn/go-colortext'
gom 'github.com/mattn/go-runewidth'
$ gom install
installing github.com/daviddengcn/go-colortext
installing github.com/mattn/go-runewidth
$ find \_vendor/src -maxdepth 2
\_vendor/src
\_vendor/src/github.com
\_vendor/src/github.com/daviddengcn
\_vendor/src/github.com/mattn
$ gom build
If you want to bundle specified tag, branch or commit
gom 'github.com/mattn/go-runewidth', :tag => 'tag_name'
gom 'github.com/mattn/go-runewidth', :branch => 'branch_name'
gom 'github.com/mattn/go-runewidth', :commit => 'commit_name'
If you want to bundle a repository that go get
can't access
gom 'github.com/username/repository', :command => 'git clone http://example.com/repository.git'
- Documentation
Yasuhiro Matsumoto mattn.jp@gmail.com