Exploring How Protobuf OneOfs Are Represented
2024-12-05 | #golang #protobug
This is a short exploration of how Protobuf3 OneOf fields are represented using Golang as our exploration medium. OneOf types, aka Tagged Unions are data structures that are used to hold one of a finite list of distinct types. A variable of a tagged union type can hold a value of one of several types defined for that tagged union type. This might be easier to understand with an example via pseudocode.