gogen-avro icon indicating copy to clipboard operation
gogen-avro copied to clipboard

Simplify union codegen

Open frankgrimes97 opened this issue 2 years ago • 5 comments

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 avatar Sep 01 '22 13:09 frankgrimes97

@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

frankgrimes97 avatar Sep 01 '22 13:09 frankgrimes97

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.

tomasfabian avatar Oct 13 '22 10:10 tomasfabian

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

Thanks!

dsincl002c avatar Oct 31 '22 18:10 dsincl002c

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

anekdoti avatar Nov 04 '22 09:11 anekdoti

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

nayanbhana avatar May 20 '23 01:05 nayanbhana