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

go-pkgz / enum
100%
master: 99%

Build:
Build:
LAST BUILD BRANCH: refs/tags/v0.6.0
DEFAULT BRANCH: master
Repo Added 16 Feb 2025 09:48AM UTC
Files 2
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

LAST BUILD ON BRANCH major-refactor-and-enhancements
branch: major-refactor-and-enhancements
CHANGE BRANCH
x
Reset
  • major-refactor-and-enhancements
  • add-go1.23-iterator
  • feat/bson-sql-yaml-support
  • feature/alias-support
  • fix-missing-import-wo-lower-flag
  • get-enum-value-by-the-int-value
  • master
  • preserve-original-value-type
  • refs/tags/v0.1.0
  • refs/tags/v0.1.1
  • refs/tags/v0.1.2
  • refs/tags/v0.1.3
  • refs/tags/v0.2.0
  • refs/tags/v0.3.0
  • refs/tags/v0.3.1
  • refs/tags/v0.4.0
  • refs/tags/v0.5.0
  • refs/tags/v0.6.0
  • split-template-from-code
  • sql
  • support-for-complex-type-names

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

Pull #15

github

umputun
Major refactor and feature enhancements for enum generator

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 integra... (continued)
Pull Request #15: Major refactor and feature enhancements for enum generator

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

2 existing lines in 1 file now uncovered.

440 of 442 relevant lines covered (99.55%)

288.82 hits per line

Relevant lines Covered
Build:
Build:
442 RELEVANT LINES 440 COVERED LINES
288.82 HITS PER LINE
Source Files on major-refactor-and-enhancements
  • Tree
  • List 2
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
16871849702 major-refactor-and-enhancements Major refactor and feature enhancements for enum generator 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... Pull #15 11 Aug 2025 05:43AM UTC umputun github
99.55
See All Builds (68)
  • Repo on GitHub
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

© 2025 Coveralls, Inc