protobuf中的枚舉缺省值應(yīng)該為ENUN_TYPE_UNSPECIFIED
(金慶的專欄 2017.11)
Googol 公布的 API Design 規(guī)范中,*.proto 中的枚舉缺省值建議為 ENUN_TYPE_UNSPECIFIED。
https://mp.weixin.qq.com/s?__biz=MzA5ODg4Mzk2OQ==&mid=2247483705&idx=1&sn=cc2ffef9ac431510c1791dbe6e774b85
The first value should be named ENUM_TYPE_UNSPECIFIED as it is returned when an enum value is not explicitly specified.
enum FooBar {
// The first value represents the default and must be == 0.
FOO_BAR_UNSPECIFIED = 0;
FIRST_VALUE = 1;
SECOND_VALUE = 2;
}
參考:protobuf中的枚舉缺省值應(yīng)該為UNKNOWN
http://blog.csdn.net/jq0123/article/details/52219597
(金慶的專欄 2017.11)
Googol 公布的 API Design 規(guī)范中,*.proto 中的枚舉缺省值建議為 ENUN_TYPE_UNSPECIFIED。
https://mp.weixin.qq.com/s?__biz=MzA5ODg4Mzk2OQ==&mid=2247483705&idx=1&sn=cc2ffef9ac431510c1791dbe6e774b85
The first value should be named ENUM_TYPE_UNSPECIFIED as it is returned when an enum value is not explicitly specified.
enum FooBar {
// The first value represents the default and must be == 0.
FOO_BAR_UNSPECIFIED = 0;
FIRST_VALUE = 1;
SECOND_VALUE = 2;
}
參考:protobuf中的枚舉缺省值應(yīng)該為UNKNOWN
http://blog.csdn.net/jq0123/article/details/52219597


