3 ms·
You need the intermediate struct, because there may be multiple entries in the oneof that share the same type. Not having the intermediate struct would make it
by EdSchouten 7y ago
You need the intermediate struct, because there may be multiple entries in the oneof that share the same type. Not having the intermediate struct would make it impossible to distinguish them.
- atombender 7y agoThat seems like a rare edge case. Simple solution: Only use an intermediate struct if actually needed.
- EdSchouten 7y agoThat has the downside of causing build breakage if seemingly unrelated fields are added/removed from Protobuf messages.