Open wpecker opened 6 years ago
group has been deprecated for years and years. So years ago 2012 when this was already deprecated I decided it was not worth the effort to support it in every plugin. I welcome a pull request and will provide guidance, if you would like to add support for group.
Why not simply use a message instead of a goup?
OK, thanks , i know , i have been use version proto3
proto2 is fine, but group specifically has been deprecated for a while. Is there some reason you want to use group instead of message?
@awalterschulze Thanks.
The company's old project or use a large number of proto2, can not switch to proto3 within a short time
Message is still in proto 2. You don't have to switch to proto 3
On Sat, 22 Jul 2017, 14:18 Kent.Xiao, notifications@github.com wrote:
@awalterschulze https://github.com/awalterschulze Thanks.
The company's old project or use a large number of proto2, can not switch to proto3 within a short time
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/gogo/protobuf/issues/311#issuecomment-317179959, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvsLTO0H5gI-SJVfX_l-i_-Gb7nKT-gks5sQeiMgaJpZM4OfUJW .
@awalterschulze Temporarily unable to switch all project to proto3 version, just want to use gofast_out to improve performance.
Again you don't need to switch to proto3
I am propsing this
syntax = "proto2";
package pbdata;
message ValueType {
optional int32 int_type =1;
optional int64 long_type = 2;
optional float float_type = 3;
optional string string_type =4;
}
message Log {
required int64 log_timestamp =1;
optional string ip = 2;
optional message Field = 3 {
repeated message Map = 1 {
required string key = 1;
optional ValueType value = 2;
}
}
}
Only changing your groups to messages.
@awalterschulze Thanks, I have checked, there are mistakes:
cct1.pb.proto:15:37: Expected ";".
cct1.pb.proto:23:1: Reached end of input in message definition (missing '}').
line 15 is optional message Field = 3 {
Ok sorry my bad What about?
syntax = "proto2";
package pbdata;
message ValueType {
optional int32 int_type =1;
optional int64 long_type = 2;
optional float float_type = 3;
optional string string_type =4;
}
message Log {
required int64 log_timestamp =1;
optional string ip = 2;
message FieldMsg {
message MapMsg {
required string key = 1;
optional ValueType value = 2;
}
repeated MapMsg Map = 1;
}
optional FieldMsg Field = 3;
}
@awalterschulze Great! Thanks
My pleasure. Even though your issue is solved, I think we can still keep the issue open, since gogo protobuf still does not support groups.
The proto file as below:
protoc --gofast_out=. cct.pb.proto