Skip to content

Tags: go-pkgz/enum

Tags

v0.7.0

Toggle v0.7.0's commit message

Verified

This commit was signed with the committer’s verified signature.
umputun Umputun
fix prealloc lint issue in parseDocComment

v0.6.0

Toggle v0.6.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
add alias support for enum parsing (#17)

allows enum constants to have comment annotations like
// enum:alias=rw,read-write that enable parsing multiple
string representations for the same enum value.

- add parseAliasComment() to extract aliases from inline comments
- add validateAliases() to check for conflicts and duplicates
- update template to include aliases in parse map
- make parsing always case-insensitive (fixes lowercase mode bug)
- add comprehensive tests for alias feature
- update README with alias documentation

v0.5.0

Toggle v0.5.0's commit message
Version 0.5.0

v0.4.0

Toggle v0.4.0's commit message
Release v0.4.0

Performance Improvements:
- O(1) map-based parsing replacing switch statements (10x faster)
- Pre-computed Values and Names as package variables instead of functions
- Single shared enum instances to reduce memory allocation

New Features:
- SQL support with driver.Valuer and sql.Scanner interfaces
- Smart SQL NULL handling (uses zero value when available, errors otherwise)
- Index() method for accessing underlying integer values
- -getter flag for generating GetTypeByID functions (with validation for unique values)
- -lower flag for lowercase string representation in marshaling
- Preserve underlying type information (uint8, int32, etc.) in generated code

Improvements:
- Preserve source declaration order (was alphabetical before)
- Character literal support ('A', '\n', '\x00', etc.)
- Enhanced error messages with specific invalid value reporting
- Better binary expression handling with iota operations
- Fixed iota increment bug (now increments per ValueSpec as Go spec requires)
- Proper handling of underscore placeholders in const blocks
- Better edge case handling (division by zero, empty blocks)

Testing & Quality:
- Test coverage improved from 90.5% to 99.6%
- Comprehensive test suite for all new features
- Updated documentation with SQL examples and feature descriptions

v0.3.1

Toggle v0.3.1's commit message
Fix handling of binary expressions with iota

v0.3.0

Toggle v0.3.0's commit message
Fix linter issues and add dummy usage of enum constants to prevent li…

…nter warnings

v0.2.0

Toggle v0.2.0's commit message
Changes by the review

v0.1.3

Toggle v0.1.3's commit message
make sure imports in the generated files follow goimport convention

v0.1.2

Toggle v0.1.2's commit message
nit: fix typo in generated header comment

v0.1.1

Toggle v0.1.1's commit message
Integrate dynamic version retrieval using debug.ReadBuildInfo