GitHub user antonlindstrom opened a pull request:
https://github.com/apache/thrift/pull/369
THRIFT-2189 add union support for go generator
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.
Thanks!
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/antonlindstrom/thrift
feature/go-generator-union
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/369.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #369
----
commit a7f0fc25ad0f2f245dadf753f53d640d3afcb8b2
Author: Anton Lindström <[email protected]>
Date: 2015-01-30T09:28:16Z
THRIFT-2189 add union support for go generator
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.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---