Closed
Description
A struct like
message A {
optional string e = 3;
oneof b {
string c = 1;
string d = 2;
}
}
Generates the following go code
type A struct {
E *E `protobuf:"bytes,3,opt,name=e" json:"e,omitempty"`
// Types that are valid to be assigned to B
// * B_C
// * B_D
B isA_B `protobuf_oneof:"value"`
}
...
type struct {
C string `protobuf:"bytes,1,opt,name=c,oneof"`
}
type struct {
D string `protobuf:"bytes,2,opt,name=d,oneof"`
}
...
The oneof field structs should also have json go tags so they can serialize to JSON correctly.
Metadata
Metadata
Assignees
Labels
No labels