donglusou3335 2015-04-08 03:15
浏览 186

如何在proto3中复制未知字段的功能?

Google has removed unknown fields in proto3. I would love to hear the reasoning behind this choice. Also, if anyone has any way to replicate the proto2 behavior I would love to hear it.

If it matters, we are writing our code in Go.

As proto3 and grpc were developed in parallel, I wanted to reach out to the grpc community as well.

Source: Removal of unknown fields

  • 写回答

1条回答 默认 最新

  • dongshu4755 2015-06-04 16:08
    关注

    Getting rid of field presence for primitives makes Protobuf more "natural" and efficient in many languages, since primitives in C/C++, Java, C#, and Go must be present. In such languages, if you want presence information you "box" the primitive by making it a pointer to a primitive.

    Protobuf 3 gets rid of presence for primitives but still has it for messages. Thus, you can use the same "boxing" technique for Protobuf. Protobuf now has standard messages that box primitives.

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测