Protobuf 2.6.0 has been released
(https://github.com/google/protobuf/releases/tag/v2.6.0)
It has added a "oneof" keyword for defining unions. goprotobuf just generates
the objects treating all the fields as optional.
In the core implementations, they add an enum and extra code that automatically
unsets the other fields.
Java:
https://developers.google.com/protocol-buffers/docs/reference/java-generated#one
of
C++:
https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#oneo
f
Python:
https://developers.google.com/protocol-buffers/docs/reference/python-generated#o
neof
Original issue reported on code.google.com by jhaw...@gmail.com on 8 Sep 2014 at 7:22
Original issue reported on code.google.com by
jhaw...@gmail.com
on 8 Sep 2014 at 7:22