liveBook · Manning

Dependency management

As explained in Go in Practice, Second Edition

Dependency management is the process of declaring, resolving, obtaining, and maintaining software components required by an application.

Go handles packages and dependencies through its built-in toolchain. The go executable provides compilation alongside lightweight package management; go mod supplies module-based dependency support. Keeping these tasks in one toolchain makes dependency handling part of ordinary application development. section 1.1 section 1.2.4

An import names a package from the standard library, a local module, or an external path. Code refers to imported functionality through the package name, as in fmt.Println. Imports can be grouped; by convention, standard-library packages precede external packages. Package handling is designed with compilation in mind, supporting fast builds while making trade-offs for that speed. section 1.2.4 section 1.2.4

import (
    "fmt"
    "net/http"

    "golang.org/x/net/html"   #1
)

Compare the standard-library imports fmt and net/http with the external path golang.org/x/net/html in one import group. section 1.2.4

Dependency command

The illustrated command is `go get ./...`. It appears alongside imports as a toolchain operation for working with packages. section 1.2.4

How Go in Practice, Second Edition covers it

How deep it goes
Explains import names, grouping, package prefixes, and compile-time motivation, but does not detail dependency version resolution or maintenance.
Examples
Uses fmt.Println, grouped standard-library and external imports, and the `go get ./...` command.
What it assumes
Introduces package imports through a small Go program; assumes familiarity with basic program structure.
What you can do after
Apply it via go mod and package imports to work with standard-library, local-module, and external packages.
How it connects
Connects dependency management to Go modules, package imports, the standard library, and compiler performance.

Also explained in

Compare how 5 books explain dependency management →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Go in Practice, Second Edition. The section links point to the parts of the book it draws on.