Releases: zarldev/goenums
v0.4.4
v0.4.3
v0.4.2
- Improved parsing of enum fields and aliases
- Better error handling in failfast mode with enum-specific errors
- InvalidEnum uses calculated index to never match a real enum
- Enhanced quote and space handling in enum definitions
- Enhanced time handling in enum field type definitions
v0.4.0
v0.3.8 Extended Default Interfaces
Release v0.3.8
I am excited to announce the release of goenums v0.3.8! This update includes new features, important bug fixes, and improvements designed to enhance the robustness and usability of generated enums, especially in edge cases.
🚀 New Features and Improvements
-
Added Text Marshalling and Unmarshalling support
Generated enum types now implement theencoding.TextMarshalerandencoding.TextUnmarshalerinterfaces, enabling seamless text encoding and decoding. This enhancement complements existing JSON, binary, and database support, improving interoperability with various encoding scenarios. -
Added Binary Marshalling and Unmarshalling support
Complementing text encoding, enums now also support binary marshaling interfaces (encoding.BinaryMarshalerandencoding.BinaryUnmarshaler), facilitating efficient binary serialization for networking and storage use cases. -
Improved plural enum handling in code generation
I fixed edge cases where enums with plural names resulted in incorrect pluralization or inconsistent method names. The generator now correctly detects when enum type names are already plural and handles them appropriately, ensuring idiomatic and predictable code generation.
🐛 Bug Fixes
- Fixed off-by-one and boundary errors in string conversion methods, supporting both zero-based and one-based enum bases reliably.
- Corrected integer-to-enum conversion function offsets aligning precisely with enum starting values.
- Resolved incorrect string output issues for enum values in various boundary conditions.
- Enhanced parsing and generation logic for enums with extra embedded fields, improving coverage of advanced use cases.
📚 Documentation and Examples
- I updated documentation and example markdown files to demonstrate new encoding features and plural handling clarifications.
Upgrade to v0.3.8 to leverage these enhancements and improved code generation accuracy. Your feedback and contributions are always welcome at https://github.com/zarldev/goenums.
Thank you for using goenums! 🎉
v0.3.6
Release Notes: goenums v0.3.6
Overview
Version 0.3.6 enhances goenums with improved string handling capabilities, support for multiple aliases, adoption of Go 1.21+ range-over-func features, and various bug fixes for improved stability and performance.
New Features
- Enhanced String Support: Improved handling of string literals and operations for more robust enum generation
- Multiple Alias Support: Added capability to handle multiple aliases for enum values, providing greater flexibility
- Go 1.21+ Range Over Func: Leveraged Go 1.21's range-over-func feature for cleaner iteration code generation while maintaining backward compatibility
- New Documentation: Documentation
Bug Fixes
- Fixed issues with enum code generation
- Resolved inconsistencies in case-insensitive string parsing
- Improved error handling for more informative debugging
- Fixed edge cases in enum parsing from Go source files
Other Improvements
- Code refactoring for better maintainability
- Performance optimizations for enum generation
- Enhanced documentation and logging
- General stability improvements across multiple input files
Requirements
- Go 1.21 or higher (for full feature support)
- Legacy mode available for older Go versions
Upgrading
This release maintains backward compatibility with previous versions. Simply update your dependencies to use v0.3.6.
v0.3.5
Parse bug fix for ints on non 0 indexed enums
Better error message when failing to parse and in failfast mode.
Full Changelog: v0.3.4...v0.3.5
v0.3.4
Better handling of all cases for custom String representations.
Full Changelog: v0.3.3...v0.3.4