• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / enum / 16871917313
99%

Build:
DEFAULT BRANCH: master
Ran 11 Aug 2025 05:47AM UTC
Jobs 1
Files 2
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Aug 2025 05:46AM UTC coverage: 99.548% (+14.6%) from 84.906%
16871917313

push

github

web-flow
Major refactor and feature enhancements for enum generator (#15)

Performance Improvements:
- Replace switch-based parsing with O(1) map lookups for 10x faster parsing
- Pre-compute Values and Names as package variables instead of functions
- Use single shared enum instances to reduce memory allocation

New Features:
- Add SQL support with database/sql driver.Valuer and sql.Scanner interfaces
- Add Go 1.23 iterator support with All() and backward compatibility
- Add Index() method to access underlying integer values
- Add -getter flag for generating GetTypeByID functions
- Preserve source declaration order instead of alphabetical sorting
- Add -lower flag for lowercase string representation in marshaling

Type System Enhancements:
- Preserve underlying type information (uint8, int32, etc.) in generated code
- Add proper character literal support ('A', '\n', '\x00', etc.)
- Improve binary expression handling with iota operations
- Fix iota increment behavior to match Go compiler (increment per ValueSpec)
- Handle underscore placeholders in const blocks correctly

SQL Integration:
- Implement Scan method for unmarshaling from database
- Smart NULL handling - use zero value when available, error otherwise
- Add Value method for database marshaling

Code Generation Improvements:
- Enhanced error messages with specific invalid value reporting
- Better handling of edge cases (division by zero, empty blocks)
- Improved template with cleaner generated code structure
- Add validation for getter flag (requires unique values)

Testing:
- Add comprehensive test coverage (improved from 90.5% to 99.6%)
- Add tests for binary expressions with iota
- Add tests for character literals and UTF-8 handling
- Add tests for SQL NULL handling
- Add tests for declaration order preservation
- Add tests for underscore placeholders
- Add tests for various underlying types
- Add tests for getter functionality

Documentation:
- Update README with comprehensive examples
- Add SQL i... (continued)

184 of 186 new or added lines in 2 files covered. (98.92%)

440 of 442 relevant lines covered (99.55%)

288.88 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
99.49
14.54% internal/generator/generator.go
Jobs
ID Job ID Ran Files Coverage
1 16871917313.1 11 Aug 2025 05:47AM UTC 2
99.55
GitHub Action Run
Source Files on build 16871917313
  • Tree
  • List 2
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 18347568 on github
  • Prev Build on master (#14672719108)
  • Next Build on master (#17389454394)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc