Golang modules: Difference between revisions
From wikinotes
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
</blockquote><!-- Creating/Requiring Modules --> | </blockquote><!-- Creating/Requiring Modules --> | ||
</blockquote><!-- Modules --> | </blockquote><!-- Modules --> | ||
== Module Requirements == | |||
<blockquote> | |||
See also [[go.mod file]] . | |||
<syntaxhighlight lang="bash"> | |||
go mod graph # show requirements tree | |||
go mod tidy # ensure go.mod matches src | |||
go mod vendor # | |||
go get ... # add requirement to go.mod | |||
</syntaxhighlight> | |||
</blockquote><!-- Module Requirements --> | |||
== Vendoring == | |||
<blockquote> | |||
</blockquote><!-- Vendoring --> |
Revision as of 13:54, 19 June 2022
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