Golang modules

From wikinotes
Revision as of 13:54, 19 June 2022 by Will (talk | contribs)

Go modules are a collection of packages that are intended to be released together.
You define your project requirements in at the module level,
and you can publish module-versions to the go package index.

Modules

Creating/Requiring Modules

See go.mod file.

Module Requirements

See also go.mod file .

go mod graph       # show requirements tree
go mod tidy    # ensure go.mod matches src
go mod vendor  #
go get ...     # add requirement to go.mod

Vendoring