Go CLI Modules and Workspaces/Vendor dependencies

Copy dependencies into a vendor directory.

Section: Editing and Replacements

Vendor dependencies

bash
bash
go mod vendor
Explanation

Copy dependencies into a vendor directory. Useful in Go CLI workflows.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Editing and Replacements
Add replace directive
Point a module dependency to a local checkout.
OpenIn sheetbashsame section
Add require directive
Add an explicit module requirement.
OpenIn sheetbashsame section
Set go line
Set the minimum Go version in go.mod.
OpenIn sheetbashsame section
Inspect current module JSON
Inspect current module metadata.
OpenIn sheetbashsame section
Initialize module
Create a new go.mod for the current project.
OpenIn sheetbash2 tag match
Tidy dependencies
Add missing and remove unused module requirements.
OpenIn sheetbash2 tag match