Skip to content

proto.Size returns 0 for proto3 oneof zero values #74

@awalterschulze

Description

@awalterschulze
syntax = "proto3";

message SampleOneof {
  oneof test_oneof {
    bool Field1 = 1;
    float Field2 = 2;
}

If I set the Field1 to false and call proto.Size it returns 0 where it should return 2.
Basically in properties.go the setEncAndDec method should only set enc_proto3_... and size_proto3_... when proto3 is true and oneof is false.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions