github zarldev/goenums v0.3.8
v0.3.8 Extended Default Interfaces

latest releases: v0.4.4, v0.4.3, v0.4.2...
6 months ago

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 the encoding.TextMarshaler and encoding.TextUnmarshaler interfaces, 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.BinaryMarshaler and encoding.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! 🎉

Don't miss a new goenums release

NewReleases is sending notifications on new releases.