[
https://issues.apache.org/jira/browse/THRIFT-2189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14301427#comment-14301427
]
ASF GitHub Bot commented on THRIFT-2189:
----------------------------------------
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.
----
> Go needs "isset" to fully support "union" type (and optionals)
> --------------------------------------------------------------
>
> Key: THRIFT-2189
> URL: https://issues.apache.org/jira/browse/THRIFT-2189
> Project: Thrift
> Issue Type: Bug
> Components: Go - Compiler
> Reporter: Jack L
> Assignee: Jens Geyer
> Fix For: 1.0
>
>
> Go thrift compiler does not support union types
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)