LinuxCommandLibrary

dep

Manage Go dependencies (deprecated tool)

TLDR

Interactively initialize deployer in the local path (use a framework template with --template=template)

$ dep init
copy

Deploy an application to a remote host
$ dep deploy [hostname]
copy

Rollback to the previous working release
$ dep rollback
copy

Connect to a remote host via SSH
$ dep ssh [hostname]
copy

List commands
$ dep list
copy

Run any arbitrary command on the remote hosts
$ dep run "[command]"
copy

Display help for a command
$ dep help [command]
copy

SYNOPSIS

dep ensure [flags]

PARAMETERS

-v
    Enable verbose output

-update
    Update dependencies to latest allowed version

-vendor-only
    Perform only the vendor step.

-dry-run
    Report actions that would be taken, but do not perform them.

-skip-ensure
    Skip running `dep ensure`, useful in CI/CD pipelines.

-source-only
    Only fetch source code; don't update vendor directory.

-n
    Set the number of parallel workers for downloads (default 24).

DESCRIPTION

dep is a command-line tool used for managing dependencies in Go projects. It acts as a package manager, similar to npm for Node.js or pip for Python, but specifically designed for Go's dependency system.
dep allows you to declare the external libraries your project relies on, ensuring that your project builds reproducibly. It manages the versions of these dependencies, addresses the problem of vendoring (copying dependencies into your project), and provides a way to resolve conflicts between different dependency versions.
It promotes predictable and repeatable builds, isolates your project from upstream changes, and improves your development workflow.

CAVEATS

dep is deprecated in favor of Go modules (introduced in Go 1.11). While it may still work for existing projects, it's highly recommended to migrate to Go modules for new projects and to transition existing projects as time permits.

GOPKG.TOML

The Gopkg.toml file is the configuration file used by dep to specify project dependencies and their version constraints. It declares dependencies and their allowed versions or revisions.

GOPKG.LOCK

The Gopkg.lock is a file that dep generates to track the exact versions of dependencies used in a project. This file ensures that everyone building the project uses the same versions of the dependencies, providing reproducible builds. The lock file should always be committed to version control.

HISTORY

dep emerged to address the lack of a standard dependency management solution in Go. It was created to simplify vendoring and version management, addressing challenges like diamond dependencies and unrepeatable builds. dep helped define the vendor directory as the standard location for dependencies. With the introduction of Go modules (Go 1.11), a built-in dependency management solution, dep's relevance has diminished.

SEE ALSO

go mod(1)

Copied to clipboard