dept

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 3 Imported by: 0

README

dept

CircleCI codecov

Go modules based dependency management for Go tools.

Description

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.

Requirements

  • Go v1.13 or later

Basic usage

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 init

Then, let's install Go tools you want to use in your project.

$ dept get github.com/mitchellh/gox github.com/tcnksm/ghr@v0.12.0
$ 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.0

If you want to installed commands without dept, please run build.

$ dept build
$ ls _tools
ghr     gox     lint

Available commands

init
$ dept init
get

dept 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/gox@v0.3.0
$ dept get github.com/mitchellh/gox@v0.1.0

To install a binary with another name:

$ dept get -o lint github.com/golangci-lint/cmd/golangci-lint

Update tools to the latest version:

$ dept get -u github.com/mitchellh/gox
$ dept get -u # update all tools
remove

dept remove uninstalls passed tools.

$ dept remove github.com/mitchellh/gox
exec

dept exec executes the passed tool with arguments.

$ dept exec ghr -v
build

dept build builds all tools.

$ dept build

If $GOBIN enabled, it will be used preferentially.

$ GOBIN=$PWD/bin dept build

Also, -d flag is provided.

$ dept build -d bin
list

dept 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.0

You can format output with -f flag.

$ dept list -f '{{ .Name }}'
lint
gox
ghr
clean

dept clean cleans up all cached tools.

$ dept clean

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package app provides the application entrypoint.
Package app provides the application entrypoint.
Package cmd provides methods to initialize each sub-command.
Package cmd provides methods to initialize each sub-command.
Package deptfile provides the structure of deptfile and functions to control it.
Package deptfile provides the structure of deptfile and functions to control it.
Package filegen provides a Go file generator which contains required Go tools in import statement.
Package filegen provides a Go file generator which contains required Go tools in import statement.
Package gocmd provides Go command.
Package gocmd provides Go command.
Package toolcacher provides a binary caching mechanism.
Package toolcacher provides a binary caching mechanism.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL