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 vendor

Related terms

Taught in

References