“Extend keyword in protobuf” can be translated as “Protobuf 中的扩展关键字” in Chinese.

huangapple go评论45阅读模式
英文:

Extend keyword in protobuf

问题

"extend" 在 protobuf 中的作用是什么?
举例来说,在一个 .proto 文件中,我有以下内容:

extend ReportConfig {
  optional PerfStandardReportConfig perf_standard_report = 201;
  optional PerfCategoryReportConfig perf_category_report = 202;
}
英文:

What does extend do in protobuf?
For example, in a .proto file I have something like

extend ReportConfig {
  optional PerfStandardReportConfig perf_standard_report = 201;
  optional PerfCategoryReportConfig perf_category_report = 202;
}

答案1

得分: 1

The extend keyword in Protobuf is used to define extensions to a message type. Extensions are a way to add new fields to a message type without having to change the original message type definition.

P.S: extend is a discouraged feature from Protobuf version 3.

英文:

The extend keyword in Protobuf is used to define extensions to a message type. Extensions are a way to add new fields to a message type without having to change the original message type definition.

P.S: extend is a discouraged feature from Protobuf version 3

huangapple
  • 本文由 发表于 2023年5月25日 21:57:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76333106.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定