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

go-pkgz / enum / 17389454394
99%

Build:
DEFAULT BRANCH: master
Ran 02 Sep 2025 12:06AM 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

02 Sep 2025 12:04AM UTC coverage: 99.573% (+0.03%) from 99.548%
17389454394

push

github

web-flow
Add BSON, SQL, and YAML support with conditional generation (#16)

* feat(generator): add BSON, SQL, and YAML support with conditional generation

Implement conditional code generation for database and serialization support:
- Add -sql flag for database/sql driver.Valuer and sql.Scanner interfaces
- Add -bson flag for MongoDB BSON marshaling/unmarshaling support
- Add -yaml flag for gopkg.in/yaml.v3 support
- All features are opt-in via flags to avoid forcing dependencies

Key improvements:
- BSON values stored as strings in MongoDB (fixes empty document issue)
- Smart SQL NULL handling using zero values when available
- Comprehensive integration tests with real MongoDB and SQLite
- Runtime integration test that builds binary and verifies generated code
- Test coverage for all marshal/unmarshal operations

The generator now supports multiple database and serialization formats
while maintaining zero runtime dependencies when features aren't used.

* fix: update example tests for Values variable and add SQL flag

- Fix StatusValues and JobStatusValues references (now variables, not functions)
- Add -sql flag to go:generate directives since SQL is no longer default
- Update expected output in example tests to match actual enum order
- These tests were broken since the August 11 major refactor that changed Values from function to variable

* test: skip runtime integration test in CI to avoid timeout

The test downloads dependencies and runs go mod tidy which times out
in GitHub Actions at 60 seconds. This test is more suitable for local
development where network access is faster.

* fix: add support for negative enum values

Copilot review identified that negative values like -1 were being
incorrectly parsed as 0. Added UnaryExpr handling in processExplicitValue
to properly support negative number literals.

Also fixed test expectation for SQL NULL handling with Priority enum
where PriorityLow (0) is the zero value, not PriorityNone (-1).

* Add comment e... (continued)

466 of 468 relevant lines covered (99.57%)

359.48 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
99.51
0.02% internal/generator/generator.go
Jobs
ID Job ID Ran Files Coverage
1 17389454394.1 02 Sep 2025 12:06AM UTC 2
99.57
GitHub Action Run
Source Files on build 17389454394
  • Tree
  • List 2
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8483a462 on github
  • Prev Build on master (#16871917313)
  • Next Build on master (#17389515208)
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