Go modules based dependency management for Go tools.
dept is a dependency management tool based on Go modules.
Instead of go.mod, dept helps you to manage Go tools.
Go tools like Golint, errcheck are often used in various environment.
dept provides you deterministic builds by manage tool dependencies.
dept is based on Go modules. All dependency resolution are provided by go mod commands.
- Go v1.13 or later
At first, let's create gotool.mod in a project root by the following command.
All tools which are managed by dept are written to gotool.mod.
$ dept initThen, let's install Go tools you want to use in your project.
$ dept get github.com/mitchellh/gox github.com/tcnksm/[email protected]
$ dept get -o lint github.com/golangci/golangci-lint/cmd/golangci-lint # rename golangci-lint as 'lint'Finally, use exec to execute installed commands.
$ dept exec ghr -v
ghr version v0.12.0If you want to installed commands without dept, please run build.
$ dept build
$ ls _tools
ghr gox lint$ dept initdept get installs binaries to the specified directory.
$ dept get github.com/mitchellh/gox You can select the specified version like Go modules:
$ dept get github.com/mitchellh/[email protected]
$ dept get github.com/mitchellh/[email protected]To install a binary with another name:
$ dept get -o lint github.com/golangci-lint/cmd/golangci-lintUpdate tools to the latest version:
$ dept get -u github.com/mitchellh/gox
$ dept get -u # update all toolsdept remove uninstalls passed tools.
$ dept remove github.com/mitchellh/goxdept exec executes the passed tool with arguments.
$ dept exec ghr -vdept build builds all tools.
$ dept buildIf $GOBIN enabled, it will be used preferentially.
$ GOBIN=$PWD/bin dept buildAlso, -d flag is provided.
$ dept build -d bindept list list ups all tools managed by dept.
$ dept list
github.com/golangci/golangci-lint/cmd/golangci-lint lint v1.12.3
github.com/mitchellh/gox gox v0.4.0
github.com/tcnksm/ghr ghr v0.12.0You can format output with -f flag.
$ dept list -f '{{ .Name }}'
lint
gox
ghrdept clean cleans up all cached tools.
$ dept clean