Seems odd that I can't find the answer to this, but what file extension are you supposed to use when storing serialized protobuf output in a file? Just .protobuf? The json equivalent of what I am talking about would be a .json file.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I just use .bin, but there's no actual standard here AFAIK. If protoc -o
(which emits a .proto schema in protobuf binary format as a FileDescriptorSet
) had taken a directory like all the other output options do, we could have used that as a de-facto answer, but protoc -o
is unusual in that it takes a file instead. In an old post on the protobuf group, Kenton Varda (one of the original authors) suggests that the file extension should be implementation specific (meaning: you decide) rather than simply referring to the format: https://groups.google.com/forum/#!topic/protobuf/JWZx9n8CUvw
标签:
protocol-buffers