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

go-pkgz / enum
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: refs/tags/v0.5.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 refs/tags/v0.5.0
branch: refs/tags/v0.5.0
CHANGE BRANCH
x
Reset
  • refs/tags/v0.5.0
  • add-go1.23-iterator
  • feat/bson-sql-yaml-support
  • fix-missing-import-wo-lower-flag
  • get-enum-value-by-the-int-value
  • major-refactor-and-enhancements
  • 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
  • split-template-from-code
  • sql
  • support-for-complex-type-names

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

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.38 hits per line

Relevant lines Covered
Build:
Build:
468 RELEVANT LINES 466 COVERED LINES
359.38 HITS PER LINE
Source Files on refs/tags/v0.5.0
  • 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
17389490215 refs/tags/v0.5.0 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 da... push 02 Sep 2025 12:08AM UTC web-flow github
99.57
See All Builds (63)
  • 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