oniksan/godobuf

oneof Custom type not supported

rr13k opened this issue · 3 comments

rr13k commented
message Ping {
    int64 sent_at = 1;
}

message Pong {
    int64 ping_sent_at = 1;
    int64 received_at = 2;
    int64 sent_at = 3;
}

message api_message {
    oneof notice_way {
        Ping ping = 1;
        Pong pong = 2;
    }
    string name = 7;
}
var test2 = apiProto.api_message.new()
test2.set_name("asdad")
test2.set_ping() # miss func

How to fill in values for custom types?

rr13k commented

The foundation type of oneof is possible and only appears in customization, Praising your great work at the same time

Hi @rr13k !
Are you tried to use new_ping? - It's a Message, not a Scalar.
See https://github.com/oniksan/godobuf#7-message