liveBook · Manning

Reproducible build

As explained in Go in Action, Second Edition

A reproducible build is a build process that produces the same result from the same source and dependency inputs.

A reproducible build produces consistent results from controlled source and dependency inputs. Go supports this through the coordinated use of go.mod and go.sum: one records module requirements, while the other records cryptographic checksums for dependency content and module files. section 11.1

A practical dependency workflow is:

  • Initialize a module with go mod init, establishing its module path and import prefix. section 11.1
  • Declare or fetch dependencies with go get, including specific versions when required. section 11.1

Pinned module dependencies

A service module can require a shared domain module and github.com/gorilla/mux at explicit versions, while recording transitive dependencies separately as indirect requirements.

github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=

Inspect the checksum entries that let Go verify dependency source and go.mod content before use. section 11.1

How Go in Action, Second Edition covers it

How deep it goes
Explains module initialization, dependency versioning, tidying, and checksum verification, but does not detail the complete build pipeline.
Examples
Uses go.mod, go.sum, go mod init, go get, go mod tidy, and pinned service dependencies as concrete artifacts.
What it assumes
Assumes familiarity with Go projects and packages while teaching module initialization and dependency files directly.
What you can do after
Operate/configure Go module dependencies with explicit versions, synchronized manifests, and checksum verification.
How it connects
Connects module paths, semantic versioning, dependency management, cryptographic checksums, and microservice architecture.

Related concepts

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