Go · Stage 9 – Organizing Bigger Programs · Lesson 53 of 64

Modules, go.mod, and go get

Add and track an external module dependency.

go get adds or updates a dependency requirement. Use a real reviewed module path and choose an intentional version.

Go code

go get example.com/module@v1.2.3
Line-by-line explanation
  1. go starts the toolchain.
  2. get changes module dependencies.
  3. The path identifies the module.
  4. @v1.2.3 selects a version.
Expected output
go: added example.com/module v1.2.3

This path is illustrative and may not be a real downloadable module.

go.mod records requirements. go.sum records cryptographic checksums used to verify downloaded module content.