gpt4 book ai didi

serialization - 如何在 Protocol Buffer 中弃用整个消息?

转载 作者:行者123 更新时间:2023-12-03 17:50:24 26 4
gpt4 key购买 nike

根据documentation:

不推荐使用(字段选项):如果设置为true,则表明该字段已弃用,并且不应被新代码使用。

使用示例:

message Foo {
string old_field = 1 [deprecated=true];
}
  • 我们如何弃用整个消息?
  • 最佳答案

    您可以将其设置为消息中的顶级选项:

    message Foo {
    option deprecated = true;
    string old_field = 1;
    }

    关于serialization - 如何在 Protocol Buffer 中弃用整个消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52781727/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com