vscode-weaver is a Visual Studio Code extension designed to simplify the process of writing boilerplate code for common patterns in Go programming. Currently, it supports the generation of boilerplate code for Getter, With, and Builder patterns.
Features
Getter Pattern: Easily generate getter methods for struct fields.
With Pattern: Generate with methods and option structs for setting individual fields in a fluent API style.
Builder Pattern: Create builder functions for constructing complex structs step by step.
Installation
Open Visual Studio Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or use the shortcut Ctrl+Shift+X.
Search for vscode-weaver.
Click the Install button to install the extension.
Usage
Open a Go file in Visual Studio Code.
Select the struct for which you want to generate boilerplate code.
Use the shortcut Ctrl+Shift+P to open the command palette and search for vscode-weaver.
Choose the desired pattern (Getter, With, Builder) from the available options.
The extension will generate and insert the corresponding boilerplate code in your Go file.
Contributing
Feel free to contribute by submitting issues, feature requests, or pull requests on the GitHub repository.