oneof
官方文档介绍: https://developers.google.com/protocol-buffers/docs/reference/go-generated#oneof
需要科学上网,所以直接摘录下内容,方便查阅:
Oneof Fields
For a oneof field, the protobuf compiler generates a single field with an interface type isMessageName_MyField. It also generates a struct >for each of the singular fields within the oneof. These all implement this isMessageName_MyField interface.
For this message with a oneof field:
package account;