actgardner / gogen-avro

Generate Go code to serialize and deserialize Avro schemas
MIT License
365 stars 85 forks source link

Simplify union codegen #196

Open frankgrimes97 opened 2 years ago

frankgrimes97 commented 2 years ago

Don't generate union classes when a simple union contains only two elements, one of which is null. Instead, generate pointers to the types. (Golang built-in nullability)

https://github.com/actgardner/gogen-avro/issues/184

frankgrimes97 commented 2 years ago

@actgardner Here is my first attempt at addressing the issue... any feedback is most welcome!

Hopefully this is a good first step towards a releasable feature/improvement.

N.B. In order to preserve the GenericRecord behaviour and keep its tests from failing I did need to add a genericMode irProgram option

tomasfabian commented 1 year ago

Hi @actgardner @frankgrimes97, this would be a great feature. Shall be this PR merged into master and released soon, please?

Initially I stumbled on this related but closed issue #40.

Thank you! Regards Tomas.

dsincl002c commented 1 year ago

Hi @actgardner, any update on this PR? As Tomas stated, this would be highly beneficial.

Thanks!

anekdoti commented 1 year ago

Hello @actgardner, I also would find this a great improvement to the code generation.

nayanbhana commented 1 year ago

Hi @actgardner, is this feature a possibility in the future?