protobuf 字段的多行注释
Multiline comments on field in protobuf
如何在.proto
字段中为消息字段写多行注释?
官方文档没有说明。
例如我有消息:
message LocationResponse {
City city = 1; // city info, will be filled only when `with_city` option is requested
Country country = 2; // country info, will be filled only when `with_country` option is requested
repeated Subdivision subdivisions = 3; // subdivisions info, will be filled only when `with_subdivisions` option is requested
}
message LocationResponse {
// city info, will be filled only when `with_city`
// option is requested
City city = 1;
// country info, will be filled only when `with_country`
// option is requested
Country country = 2;
// subdivisions info, will be filled only when `with_subdivisions`
// option is requested
repeated Subdivision subdivisions = 3;
}
如何在.proto
字段中为消息字段写多行注释?
官方文档没有说明。
例如我有消息:
message LocationResponse {
City city = 1; // city info, will be filled only when `with_city` option is requested
Country country = 2; // country info, will be filled only when `with_country` option is requested
repeated Subdivision subdivisions = 3; // subdivisions info, will be filled only when `with_subdivisions` option is requested
}
message LocationResponse {
// city info, will be filled only when `with_city`
// option is requested
City city = 1;
// country info, will be filled only when `with_country`
// option is requested
Country country = 2;
// subdivisions info, will be filled only when `with_subdivisions`
// option is requested
repeated Subdivision subdivisions = 3;
}