A go1.5+ dependencies manager.
More precisely, a tool to manage your project's dependencies by vendoring them at pinpointed versions.
It relies on the "GO15VENDOREXPERIMENT", so that other people (users and developers) can simply go get
your project
without being forced to use godm
or any other tool that doesn't come with Go right out of the box.
If you wish to see how does a project using godm
looks, well you got one right here :)
Vendors are there as Git submodules
Table of Contents generated with DocToc
- Status
- Dependencies
- Installation
- Upgrade
- Usage
- Bash Autocompletion
- Migrating from another dependenices management tool
Still in very early development.
Go 1.5+ (with GO15VENDOREXPERIMENT=1
), and Git (available in your $PATH)
# If you haven't already, enable the Go 1.5 vendor experiment (personally that line is in my ~/.bashrc).
export GO15VENDOREXPERIMENT=1
# Then it's a simple go get.
go get github.com/hectorj/godm/cmd/godm
go get -u github.com/hectorj/godm/cmd/godm
Note : does not support Mercurial yet
Auto-generated help is available like this :
godm --help
(thanks to https://github.com/codegangsta/cli)
The vendor
sub-command vendors imports that are not vendored yet in the current project. Outputs the import paths of vendors successfully added.
# Go to your package directory, wherever that is.
cd $GOPATH/src/myPackage
# Run it.
godm vendor
# If everything went well, you have new git submodules you can commit.
git commit -m "Vendoring done by godm"
The clean
sub-command removes vendors that are not imported in the current project. Outputs the import paths of vendors successfully removed.
# Go to your package directory, wherever that is.
cd $GOPATH/src/myPackage
# Run it.
godm clean
# If everything went well, you may have some Git submodules removals you can commit.
git commit -m "Vendors cleaning done by godm"
The remove
sub-command unvendors an import path. Takes a single import path as argument.
# Go to your package directory, wherever that is.
cd $GOPATH/src/myPackage
# Run godm
godm remove github.com/my/import/path
# If everything went well, you have a Git submodule removal you can commit.
git commit -m "Unvendoring done by godm"
Copy godm_bash_autocomplete.bash to /etc/bash_completion.d/
to get command autocompletion (highly recommended)
godep restore
GOPATH=`godep path`:$GOPATH godm save
Once you have checked the migration went well, you can eventually rm -rf ./Godeps