I've been relying on the Functional Option pattern to build clean, flexible constructors for my Go projects, but the constant need to write repetitive boilerplate for every struct became tedious and error-prone.
I built *foggo* to solve this pain point.
It's a simple, zero-dependency CLI tool that reads your configuration structs and automatically generates all the necessary, idiomatic Go code for the Functional Option pattern.
### Key Benefits: * *Massive Boilerplate Reduction:* Eliminates the manual work of writing option functions, making your code more focused on business logic. * *Consistency:* Ensures all your constructors adhere to the same, robust pattern across the entire project. * *Speed:* You define the struct, run `foggo`, and the pattern is instantly ready.
I primarily designed this for fellow Go library and package maintainers looking to standardize their configuration setup.
I'd love to hear your feedback on the utility and design of the tool, especially concerning its syntax or how it handles edge cases.
Thanks for checking it out!
*GitHub Repository:* https://github.com/rikeda71/foggo