What is goverter?
maingoverter is a code generator for creating type-safe Go converters. Unlike tools like jinzhu/copier that rely on runtime reflection, goverter generates explicit conversion code at compile time. This results in faster execution and better type safety.
Key features include:
- Fast execution: No reflection is used at runtime.
- Automatic conversion: Handles slices, maps, named types, primitive types, pointers, and structs with matching fields.
- Deep copies: Performs deep copies by default, with support for shallow copying.
- Enum support: Handles enum-like types.
- Customizable: Allows implementing custom converter methods to extend functionality.
- Error reporting: Provides clear errors during generation if target structs have unmapped fields or if types cannot be converted without information loss.