Go CLI Modules and Workspaces/Sync workspace build list

Sync workspace dependencies back to module go.mod files.

Section: Workspaces

Sync workspace build list

bash
bash
go work sync
Explanation

Sync workspace dependencies back to module go.mod files. 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 Workspaces
Initialize workspace
Create a go.work file for multiple local modules.
OpenIn sheetbashsame section
Add module to workspace
Add one or more modules to go.work.
OpenIn sheetbashsame section
Print go.work JSON
Inspect go.work configuration as JSON.
OpenIn sheetbashsame section
Recursively add modules
Add modules under a tree recursively.
OpenIn sheetbashsame section
Initialize module
Create a new go.mod for the current project.
OpenIn sheetbash1 tag match
Add replace directive
Point a module dependency to a local checkout.
OpenIn sheetbash1 tag match