wfxiang08 / goprotobuf

Automatically exported from code.google.com/p/goprotobuf
Other
0 stars 0 forks source link

protobuf 2.6.0 "oneof" #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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