THRIFT-2189 add union support for go generator
Client: Go
Patch: Anton Lindström <lindztr@gmail.com> and Jens Geyer
This closes #369
This makes it possible to check if a field is set and skips adding new ones.
Fields in unions are pointers by setting them as `t_field::T_OPTIONAL`.
To be sure that exactly one and only one field is set in a union, we count the
number of fields set and return an error if not exactly one field is set.
This is a breaking change and will require fields in unions to be passed in as
pointers.
1 file changed