blob: 338cdd9f5b3101c06c8401af578f7665b974499c [file] [log] [blame]
{"name":"gvt","tagline":"The simplest go vendoring tool, based on [gb-vendor](https://github.com/constabulary/gb)","body":"`gvt` lets you easily and \"idiomatically\" include external dependencies in your repository with the GO15VENDOREXPERIMENT to get reproducible builds.\r\n\r\n * **No need to learn a new tool or format!** \r\n You already know how to use `gvt`: just run `gvt fetch` when and like you would run `go get`. You can imagine what `gvt update` and `gvt delete` do.\r\n\r\n * **No need to change how you build your project!** \r\n `gvt` downloads packages to `./vendor/...`. With `GO15VENDOREXPERIMENT=1` the stock Go compiler will find and use those dependencies automatically (without import path or GOPATH changes).\r\n\r\n * **No need to manually chase, copy or cleanup dependencies!** \r\n `gvt` works recursively as you would expect, and lets you update vendored dependencies. It also writes a manifest to `./vendor/manifest` and never touches your system GOPATH. Finally, it strips the VCS metadata so that you can commit the vendored source cleanly.\r\n\r\n * **No need for your users and occasional contributors to install or even know about gvt!** \r\n Packages whose dependencies are vendored with `gvt` are `go build`-able and `go get`-able out of the box by Go 1.5 with `GO15VENDOREXPERIMENT=1` set.\r\n\r\n*Note that projects must live within the GOPATH tree in order to be go buildable with the GO15VENDOREXPERIMENT flag.*\r\n\r\n\r\n## Installation\r\n\r\n```\r\nGO15VENDOREXPERIMENT=1 go get -u github.com/FiloSottile/gvt\r\n```\r\n\r\n## Usage\r\n\r\nYou know how to use `go get`? That's how you use `gvt fetch`.\r\n\r\n```\r\n$ gvt fetch github.com/fatih/color\r\n2015/09/05 02:38:06 fetching recursive dependency github.com/mattn/go-isatty\r\n2015/09/05 02:38:07 fetching recursive dependency github.com/shiena/ansicolor\r\n\r\n$ tree -d\r\n.\r\n└── vendor\r\n └── github.com\r\n ├── fatih\r\n │ └── color\r\n ├── mattn\r\n │ └── go-isatty\r\n └── shiena\r\n └── ansicolor\r\n └── ansicolor\r\n\r\n9 directories\r\n\r\n$ cat > main.go\r\npackage main\r\nimport \"github.com/fatih/color\"\r\nfunc main() {\r\n color.Red(\"Hello, world!\")\r\n}\r\n\r\n$ export GO15VENDOREXPERIMENT=1\r\n$ go build .\r\n$ ./hello\r\nHello, world!\r\n\r\n$ git add main.go vendor/ && git commit\r\n\r\n```\r\n\r\nFull usage on [GoDoc ![GoDoc](https://godoc.org/github.com/FiloSottile/gvt?status.svg)](http://godoc.org/github.com/FiloSottile/gvt)\r\n\r\nIf you use `gvt` for your projects, it would definitely make my day better if you dropped a line at `gvt -at- filippo.io` :)\r\n\r\n## Alternative: not checking in vendored source\r\n\r\nSome developers prefer not to check in the source of the vendored dependencies. In that case you can add lines like these to e.g. your `.gitignore`\r\n\r\n vendor/**\r\n !vendor/manifest\r\n\r\nWhen you check out the source again, you can then run `gvt restore` to fetch all the dependencies at the revisions specified in the `vendor/manifest` file.\r\n\r\nPlease consider that this approach has the following consequences:\r\n\r\n * the package consumer will need gvt to fetch the dependencies\r\n * the dependencies will need to remain available from the source repositories: if the original repository goes down or rewrites history, build reproducibility is lost\r\n * `go get` won't work on your package\r\n\r\n## Troubleshooting\r\n\r\n### `error: tag 'fetch' not found.`\r\n\r\nThis kind of errors happens because you have an alias for `gvt` pointing to `git verify-tag`.\r\n\r\nRun this, or add it to your `~/.bashrc` / `~/.zshrc`:\r\n\r\n```\r\nunalias gvt\r\n```\r\n\r\n### `go build` can't find the vendored package\r\n\r\nMake sure you set `GO15VENDOREXPERIMENT=1`.\r\n\r\nAlso note that GO15VENDOREXPERIMENT does not apply when outside the GOPATH tree. That is, your project must be somewhere in a subfolder of `$GOPATH`.","google":"UA-37225193-1","note":"Don't delete this file! It's used internally to help with page regeneration."}