go mod vendor
The go subcommand that copies the source of every dependency into a vendor folder inside your module, so builds need no network.
In more detail
Vendoring is useful when build agents cannot reach the internet, or when you want the exact dependency source reviewed alongside your own. When a vendor folder is present and consistent, the go command builds from it. A project that uses only the standard library has nothing to vendor.
Example
go mod vendorRelated terms
- go mod tidy — The go subcommand that adds any module your code imports but go.mod lacks, and removes any it lists but no longer uses.
- dependency — Anything a program needs in order to work, such as a library, a tool or another service.
- build agent — A machine or container that runs the jobs of a continuous integration pipeline, such as compiling and testing code.
Taught in
- Go Workspaces and Modules — Concurrent Systems Programming with Go
- Parsing Arguments with flag — Concurrent Systems Programming with Go