Inspect go.work configuration as JSON.

Section: Workspaces

Print go.work JSON

bash
bash
go work edit -json
Explanation

Inspect go.work configuration as JSON. 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
Sync workspace build list
Sync workspace dependencies back to module go.mod files.
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