The examples directory contains examples with specific use cases. Each example is self-contained and part of a wider testing setup to improve QA and limit project overhead.
greetings
: Generate standard enum and enums with default value (zero value).pills
: Generate enums for all unsigned integer types.animals
: Generate enums with various case transformations.planets
: Generate various combinations of standard/default vs. undefined.booking
: Generate enums from CSV source.color
: Generate enums from CSV source with typed additional data.project
: A more realistic mix of enums.
_invalid
: Contains various invalid edge cases which are expected to produce specific user-friendly errors. You can happily ignore this directory as it is for testing puproses only.
As mentioned above, these examples are part of a wider testing setup. Each example directory contains a specific set of files:
enums.go
: contains the enum type definitions.generated.go
: contains the expected generated output.enums_test.go
: contains test files to assert that thegenerated.go
file performs as expected.config.yml
: the base configuration for the code generation.