feat: add enum generator
Goal of this PR
This PR tackles issue #428 by updating the avro generator to generate enums with the following format:
const (
SPADES Cards = "SPADES"
HEARTS Cards = "HEARTS"
DIAMONDS Cards = "DIAMONDS"
CLUBS Cards = "CLUBS"
)
Instead of the just strings
How did I test it?
Regenerate the golden files
In order to get this reviewed, please fill in the PR description.
Apologies @nrwiersma, I have update the PR description. I understand you are doing some refactor on generator, so this PR might not be needed, let me know.
Nice change. I would be concerned that this will break some peoples code. IMO, it would be better to put it behind a flag/option to avoid this and maintain the status quo.
Yep I can make as an option. I was wondering if you have any idea to avoid name clashing.
I will also create a dedicated test for this feature
I was wondering if you have any idea to avoid name clashing.
Conventionally speaking, it gets prefixed with the type, which would be singular. Like this:
const (
CardSpades Card = "SPADES"
CardHearts Card = "HEARTS"
CardDiamonds Card = "DIAMONDS"
CardClubs Card = "CLUBS"
)
hi @nrwiersma I added the enum generation as optional and add one test
waiting for this to be merged .. thanks @nrwiersma
Waiting for the review to be addressed.