我收到类似这样的消息
message Foo {
oneof Value {
string a;
string b;
string c;
string d;
string e;
}
}
如何避免编写类似以下内容的内容来写然后阅读oneof
字段:
if (choose_a)
write a
else if (choose_b)
write b
...
if (a is set)
read from a
else if (b is set)
read from b
...