Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

The Gopkg.toml file

The Gopkg.toml file serves as a manifest for controlling the dep tool's behavior. The dep init invocation will analyze the import graph of the project and produce a Gopkg.toml file with an initial set of constraints. From that point on, whenever a constraint needs to be updated (usually to bump the minimum supported version), users need to manually modify the generated Gopkg.toml file.

So what does the content of a Gopkg.toml file look like? Gopkg.toml files are composed of a list of blocks or stanzas. Each stanza contains one of the dep-supported rule types. The most frequently used rule types are as follows:

  • Constraints, which specify the range of compatible dependency versions
  • Overrides, which can force a particular ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content