Generate 'go.work' for a Project

Generate 'go.work' by using the context menu or a quick-fix with 'replace' directives.

Right-click the root folder of your project and navigate to New | Go Workspace File. When you select it, a go.work file will appear in your root folder. Existing Go modules will automatically be added to the go.work file.

Also, you can generate go.work from go.mod if you have replace directives there. Place the caret on a replace directive, press ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) to see all available intention actions, and select the Generate ‘go.work’ using ‘replace’ directives quick-fix.

Related Resources

Compare With Clipboard
Compare With Clipboard
Compare text, files or directories and even use the clipboard contents.
Custom Structure Tags
Custom Structure Tags
Add custom tags to any fields from structures.
Speed Typing
Speed Typing
Quickly navigate to or filter any list of items in the IDE