github.com/mattn/gom@v0.0.0-20190726063113-0ebf2b5d812d/README.mkd (about) 1 gom - Go Manager 2 ================ 3 4 [![Build Status](https://travis-ci.org/mattn/gom.png?branch=master)](https://travis-ci.org/mattn/gom) 5 6 Why 7 --- 8 9 The `go get` command is useful. But we want to fix the problem where package versions are different from the latest update. 10 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. 11 Ruby's bundle is awesome. 12 13 Installation 14 ------------ 15 16 go get github.com/mattn/gom 17 18 Gomfile 19 ------- 20 21 gom 'github.com/mattn/go-runewidth', :tag => 'go1' 22 gom 'github.com/mattn/go-scan', :commit => 'ecb144fb1f2848a24ebfdadf8e64380406d87206' 23 gom 'github.com/daviddengcn/go-colortext' 24 gom 'github.com/mattn/go-ole', :goos => 'windows' 25 26 # Execute only in the "test" environment. 27 group :test do 28 gom 'github.com/mattn/go-sqlite3' 29 end 30 31 # Execute only for the "custom_group" group. 32 group :custom_group do 33 gom 'github.com/golang/lint/golint' 34 end 35 36 By default `gom install` install all packages, except those in the listed groups. 37 You can install packages from groups based on the environment using flags (`development`, `test` & `production`) : `gom -test install` 38 39 Custom groups my be specified using the -groups flag : `gom -test -groups=custom_group,special install` 40 41 Usage 42 ----- 43 44 Create \_vendor directory and bundle packages into it 45 46 gom install 47 48 Build on current directory with \_vendor packages 49 50 gom build 51 52 Run tests on current directory with \_vendor packages 53 54 gom test 55 56 Generate .travis.yml that uses `gom test` 57 58 gom gen travis-yml 59 60 You can always change the name relative to the current `$GOPATH` directory using an environment variable: `GOM_VENDOR_NAME` 61 62 ```bash 63 $ # to use a regular $GOPATH/src folder you should specify GOM_VENDOR_NAME equal '.' 64 $ GOM_VENDOR_NAME=. gom <command> 65 ``` 66 67 Tutorial 68 -------- 69 70 Writing Gomfile and bundle 71 72 $ ls 73 main.go 74 75 $ gom gen gomfile 76 77 $ cat Gomfile 78 gom 'github.com/daviddengcn/go-colortext' 79 gom 'github.com/mattn/go-runewidth' 80 81 $ gom install 82 installing github.com/daviddengcn/go-colortext 83 installing github.com/mattn/go-runewidth 84 85 $ find \_vendor/src -maxdepth 2 86 \_vendor/src 87 \_vendor/src/github.com 88 \_vendor/src/github.com/daviddengcn 89 \_vendor/src/github.com/mattn 90 91 $ gom build 92 93 If you want to bundle specified tag, branch or commit 94 95 gom 'github.com/mattn/go-runewidth', :tag => 'tag_name' 96 gom 'github.com/mattn/go-runewidth', :branch => 'branch_name' 97 gom 'github.com/mattn/go-runewidth', :commit => 'commit_name' 98 99 If you want to bundle a repository that `go get` can't access 100 101 gom 'github.com/username/repository', :command => 'git clone http://example.com/repository.git' 102 103 If you want to change local repository directory with command 'git clone', also skipdep and insecure, which is useful in internal network environment. 104 105 gom 'github.com/username/repository', :private => 'true', :target => 'repository', :insecure=>'true', :skipdep=>'true' 106 107 Todo 108 ---- 109 110 * Documentation 111 112 Author 113 ------ 114 115 Yasuhiro Matsumoto mattn.jp@gmail.com 116 117 License 118 ------- 119 120 MIT: http://mattn.mit-license.org/2013