LinuxCommandLibrary

dep

legacy dependency management for Go

TLDR

Initialize dependency management for project

$ dep init
copy
Add a dependency
$ dep ensure -add [github.com/pkg/errors]
copy
Update all dependencies
$ dep ensure -update
copy
Update specific dependency
$ dep ensure -update [github.com/pkg/errors]
copy
Check dependency status
$ dep status
copy
Visualize dependency tree
$ dep status -dot | dot -Tpng -o deps.png
copy

SYNOPSIS

dep command [options]

DESCRIPTION

dep was the official dependency management tool for Go before Go modules became the standard. It manages project dependencies through Gopkg.toml and Gopkg.lock files, ensuring reproducible builds.
The tool resolves transitive dependencies, handles version constraints, and vendors dependencies in the vendor directory. The ensure command is the primary interface for adding, updating, and synchronizing dependencies.
dep uses semantic import versioning and supports various version constraint syntaxes including semver ranges, branches, and revisions.

PARAMETERS

COMMAND

Operation: init, ensure, status, prune, check.
init
Initialize new project with dep.
ensure
Ensure dependencies are satisfied.
-add PACKAGE
Add a dependency.
-update [PACKAGE]
Update dependencies.
status
Show status of dependencies.
prune
Remove unused dependencies.
-v
Verbose output.
--help
Display help information.

CONFIGURATION

Gopkg.toml

Project dependency constraints and metadata configuration.
Gopkg.lock
Generated lock file with exact dependency versions and hashes.

CAVEATS

Superseded by Go modules (go mod) in Go 1.11+. New projects should use Go modules. Migration path available from dep to modules. Only supports projects in GOPATH.

HISTORY

dep was developed by the Go community and released in 2016 as the official experiment in dependency management. It served as a bridge solution until Go modules were introduced in Go 1.11 (2018), after which dep was placed in maintenance mode.

SEE ALSO

go(1), govendor(1), glide(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community