Reduce a bunch of generated code in oneof sizers. (#557)
There's no need for oneof sizers to compute the size of the tag/wire
varint, since it can be computed at proto compile time instead (and it
is typically a small number like 1 or 2).
diff --git a/_conformance/conformance_proto/conformance.pb.go b/_conformance/conformance_proto/conformance.pb.go
index 8c1e3ca..cad3622 100644
--- a/_conformance/conformance_proto/conformance.pb.go
+++ b/_conformance/conformance_proto/conformance.pb.go
@@ -243,11 +243,11 @@
// payload
switch x := m.Payload.(type) {
case *ConformanceRequest_ProtobufPayload:
- n += proto.SizeVarint(1<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.ProtobufPayload)))
n += len(x.ProtobufPayload)
case *ConformanceRequest_JsonPayload:
- n += proto.SizeVarint(2<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.JsonPayload)))
n += len(x.JsonPayload)
case nil:
@@ -471,27 +471,27 @@
// result
switch x := m.Result.(type) {
case *ConformanceResponse_ParseError:
- n += proto.SizeVarint(1<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.ParseError)))
n += len(x.ParseError)
case *ConformanceResponse_SerializeError:
- n += proto.SizeVarint(6<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.SerializeError)))
n += len(x.SerializeError)
case *ConformanceResponse_RuntimeError:
- n += proto.SizeVarint(2<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.RuntimeError)))
n += len(x.RuntimeError)
case *ConformanceResponse_ProtobufPayload:
- n += proto.SizeVarint(3<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.ProtobufPayload)))
n += len(x.ProtobufPayload)
case *ConformanceResponse_JsonPayload:
- n += proto.SizeVarint(4<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.JsonPayload)))
n += len(x.JsonPayload)
case *ConformanceResponse_Skipped:
- n += proto.SizeVarint(5<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Skipped)))
n += len(x.Skipped)
case nil:
@@ -1678,35 +1678,35 @@
// oneof_field
switch x := m.OneofField.(type) {
case *TestAllTypes_OneofUint32:
- n += proto.SizeVarint(111<<3 | proto.WireVarint)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(x.OneofUint32))
case *TestAllTypes_OneofNestedMessage:
s := proto.Size(x.OneofNestedMessage)
- n += proto.SizeVarint(112<<3 | proto.WireBytes)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *TestAllTypes_OneofString:
- n += proto.SizeVarint(113<<3 | proto.WireBytes)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(len(x.OneofString)))
n += len(x.OneofString)
case *TestAllTypes_OneofBytes:
- n += proto.SizeVarint(114<<3 | proto.WireBytes)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(len(x.OneofBytes)))
n += len(x.OneofBytes)
case *TestAllTypes_OneofBool:
- n += proto.SizeVarint(115<<3 | proto.WireVarint)
+ n += 2 // tag and wire
n += 1
case *TestAllTypes_OneofUint64:
- n += proto.SizeVarint(116<<3 | proto.WireVarint)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(x.OneofUint64))
case *TestAllTypes_OneofFloat:
- n += proto.SizeVarint(117<<3 | proto.WireFixed32)
+ n += 2 // tag and wire
n += 4
case *TestAllTypes_OneofDouble:
- n += proto.SizeVarint(118<<3 | proto.WireFixed64)
+ n += 2 // tag and wire
n += 8
case *TestAllTypes_OneofEnum:
- n += proto.SizeVarint(119<<3 | proto.WireVarint)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(x.OneofEnum))
case nil:
default:
diff --git a/jsonpb/jsonpb_test_proto/test_objects.pb.go b/jsonpb/jsonpb_test_proto/test_objects.pb.go
index 5809d01..77ae78a 100644
--- a/jsonpb/jsonpb_test_proto/test_objects.pb.go
+++ b/jsonpb/jsonpb_test_proto/test_objects.pb.go
@@ -697,23 +697,23 @@
// union
switch x := m.Union.(type) {
case *MsgWithOneof_Title:
- n += proto.SizeVarint(1<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Title)))
n += len(x.Title)
case *MsgWithOneof_Salary:
- n += proto.SizeVarint(2<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.Salary))
case *MsgWithOneof_Country:
- n += proto.SizeVarint(3<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Country)))
n += len(x.Country)
case *MsgWithOneof_HomeAddress:
- n += proto.SizeVarint(4<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.HomeAddress)))
n += len(x.HomeAddress)
case *MsgWithOneof_MsgWithRequired:
s := proto.Size(x.MsgWithRequired)
- n += proto.SizeVarint(5<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
diff --git a/proto/test_proto/test.pb.go b/proto/test_proto/test.pb.go
index b688612..f8883c3 100644
--- a/proto/test_proto/test.pb.go
+++ b/proto/test_proto/test.pb.go
@@ -3545,60 +3545,60 @@
// union
switch x := m.Union.(type) {
case *Oneof_F_Bool:
- n += proto.SizeVarint(1<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += 1
case *Oneof_F_Int32:
- n += proto.SizeVarint(2<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.F_Int32))
case *Oneof_F_Int64:
- n += proto.SizeVarint(3<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.F_Int64))
case *Oneof_F_Fixed32:
- n += proto.SizeVarint(4<<3 | proto.WireFixed32)
+ n += 1 // tag and wire
n += 4
case *Oneof_F_Fixed64:
- n += proto.SizeVarint(5<<3 | proto.WireFixed64)
+ n += 1 // tag and wire
n += 8
case *Oneof_F_Uint32:
- n += proto.SizeVarint(6<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.F_Uint32))
case *Oneof_F_Uint64:
- n += proto.SizeVarint(7<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.F_Uint64))
case *Oneof_F_Float:
- n += proto.SizeVarint(8<<3 | proto.WireFixed32)
+ n += 1 // tag and wire
n += 4
case *Oneof_F_Double:
- n += proto.SizeVarint(9<<3 | proto.WireFixed64)
+ n += 1 // tag and wire
n += 8
case *Oneof_F_String:
- n += proto.SizeVarint(10<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.F_String)))
n += len(x.F_String)
case *Oneof_F_Bytes:
- n += proto.SizeVarint(11<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.F_Bytes)))
n += len(x.F_Bytes)
case *Oneof_F_Sint32:
- n += proto.SizeVarint(12<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64((uint32(x.F_Sint32) << 1) ^ uint32((int32(x.F_Sint32) >> 31))))
case *Oneof_F_Sint64:
- n += proto.SizeVarint(13<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(uint64(x.F_Sint64<<1) ^ uint64((int64(x.F_Sint64) >> 63))))
case *Oneof_F_Enum:
- n += proto.SizeVarint(14<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.F_Enum))
case *Oneof_F_Message:
s := proto.Size(x.F_Message)
- n += proto.SizeVarint(15<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Oneof_FGroup:
- n += proto.SizeVarint(16<<3 | proto.WireStartGroup)
+ n += 2 // tag and wire
n += proto.Size(x.FGroup)
- n += proto.SizeVarint(16<<3 | proto.WireEndGroup)
+ n += 2 // tag and wire
case *Oneof_F_Largest_Tag:
- n += proto.SizeVarint(536870911<<3 | proto.WireVarint)
+ n += 10 // tag and wire
n += proto.SizeVarint(uint64(x.F_Largest_Tag))
case nil:
default:
@@ -3607,7 +3607,7 @@
// tormato
switch x := m.Tormato.(type) {
case *Oneof_Value:
- n += proto.SizeVarint(100<<3 | proto.WireVarint)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(x.Value))
case nil:
default:
@@ -3880,25 +3880,25 @@
// union
switch x := m.Union.(type) {
case *Communique_Number:
- n += proto.SizeVarint(5<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.Number))
case *Communique_Name:
- n += proto.SizeVarint(6<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Name)))
n += len(x.Name)
case *Communique_Data:
- n += proto.SizeVarint(7<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Data)))
n += len(x.Data)
case *Communique_TempC:
- n += proto.SizeVarint(8<<3 | proto.WireFixed64)
+ n += 1 // tag and wire
n += 8
case *Communique_Col:
- n += proto.SizeVarint(9<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.Col))
case *Communique_Msg:
s := proto.Size(x.Msg)
- n += proto.SizeVarint(10<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
diff --git a/protoc-gen-go/generator/generator.go b/protoc-gen-go/generator/generator.go
index d8e512e..6e1b72c 100644
--- a/protoc-gen-go/generator/generator.go
+++ b/protoc-gen-go/generator/generator.go
@@ -2624,58 +2624,49 @@
}
g.P("case *", oneofTypeName[field], ":")
val := "x." + fieldNames[field]
- var wire, varint, fixed string
+ var varint, fixed string
switch *field.Type {
case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
- wire = "WireFixed64"
fixed = "8"
case descriptor.FieldDescriptorProto_TYPE_FLOAT:
- wire = "WireFixed32"
fixed = "4"
case descriptor.FieldDescriptorProto_TYPE_INT64,
descriptor.FieldDescriptorProto_TYPE_UINT64,
descriptor.FieldDescriptorProto_TYPE_INT32,
descriptor.FieldDescriptorProto_TYPE_UINT32,
descriptor.FieldDescriptorProto_TYPE_ENUM:
- wire = "WireVarint"
varint = val
case descriptor.FieldDescriptorProto_TYPE_FIXED64,
descriptor.FieldDescriptorProto_TYPE_SFIXED64:
- wire = "WireFixed64"
fixed = "8"
case descriptor.FieldDescriptorProto_TYPE_FIXED32,
descriptor.FieldDescriptorProto_TYPE_SFIXED32:
- wire = "WireFixed32"
fixed = "4"
case descriptor.FieldDescriptorProto_TYPE_BOOL:
- wire = "WireVarint"
fixed = "1"
case descriptor.FieldDescriptorProto_TYPE_STRING:
- wire = "WireBytes"
fixed = "len(" + val + ")"
varint = fixed
case descriptor.FieldDescriptorProto_TYPE_GROUP:
- wire = "WireStartGroup"
fixed = g.Pkg["proto"] + ".Size(" + val + ")"
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- wire = "WireBytes"
g.P("s := ", g.Pkg["proto"], ".Size(", val, ")")
fixed = "s"
varint = fixed
case descriptor.FieldDescriptorProto_TYPE_BYTES:
- wire = "WireBytes"
fixed = "len(" + val + ")"
varint = fixed
case descriptor.FieldDescriptorProto_TYPE_SINT32:
- wire = "WireVarint"
varint = "(uint32(" + val + ") << 1) ^ uint32((int32(" + val + ") >> 31))"
case descriptor.FieldDescriptorProto_TYPE_SINT64:
- wire = "WireVarint"
varint = "uint64(" + val + " << 1) ^ uint64((int64(" + val + ") >> 63))"
default:
g.Fail("unhandled oneof field type ", field.Type.String())
}
- g.P("n += ", g.Pkg["proto"], ".SizeVarint(", field.Number, "<<3|", g.Pkg["proto"], ".", wire, ")")
+ // Tag and wire varint is known statically,
+ // so don't generate code for that part of the size computation.
+ tagAndWireSize := proto.SizeVarint(uint64(*field.Number << 3)) // wire doesn't affect varint size
+ g.P("n += ", tagAndWireSize, " // tag and wire")
if varint != "" {
g.P("n += ", g.Pkg["proto"], ".SizeVarint(uint64(", varint, "))")
}
@@ -2683,7 +2674,7 @@
g.P("n += ", fixed)
}
if *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {
- g.P("n += ", g.Pkg["proto"], ".SizeVarint(", field.Number, "<<3|", g.Pkg["proto"], ".WireEndGroup)")
+ g.P("n += ", tagAndWireSize, " // tag and wire")
}
}
g.P("case nil:")
diff --git a/protoc-gen-go/testdata/imp/imp.pb.go b/protoc-gen-go/testdata/imp/imp.pb.go
index 750f6a1..b781ae2 100644
--- a/protoc-gen-go/testdata/imp/imp.pb.go
+++ b/protoc-gen-go/testdata/imp/imp.pb.go
@@ -226,7 +226,7 @@
// union
switch x := m.Union.(type) {
case *ImportedMessage_State:
- n += proto.SizeVarint(9<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.State))
case nil:
default:
diff --git a/protoc-gen-go/testdata/my_test/test.pb.go b/protoc-gen-go/testdata/my_test/test.pb.go
index 0fe65e2..bad905e 100644
--- a/protoc-gen-go/testdata/my_test/test.pb.go
+++ b/protoc-gen-go/testdata/my_test/test.pb.go
@@ -57,7 +57,7 @@
return nil
}
func (HatType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{0}
+ return fileDescriptor_test_2309d445eee26af7, []int{0}
}
// This enum represents days of the week.
@@ -97,7 +97,7 @@
return nil
}
func (Days) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{1}
+ return fileDescriptor_test_2309d445eee26af7, []int{1}
}
type Request_Color int32
@@ -136,7 +136,7 @@
return nil
}
func (Request_Color) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{0, 0}
+ return fileDescriptor_test_2309d445eee26af7, []int{0, 0}
}
type Reply_Entry_Game int32
@@ -172,7 +172,7 @@
return nil
}
func (Reply_Entry_Game) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{1, 0, 0}
+ return fileDescriptor_test_2309d445eee26af7, []int{1, 0, 0}
}
// This is a message that might be sent somewhere.
@@ -200,7 +200,7 @@
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{0}
+ return fileDescriptor_test_2309d445eee26af7, []int{0}
}
func (m *Request) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Request.Unmarshal(m, b)
@@ -298,7 +298,7 @@
func (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) }
func (*Request_SomeGroup) ProtoMessage() {}
func (*Request_SomeGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{0, 0}
+ return fileDescriptor_test_2309d445eee26af7, []int{0, 0}
}
func (m *Request_SomeGroup) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Request_SomeGroup.Unmarshal(m, b)
@@ -338,7 +338,7 @@
func (m *Reply) String() string { return proto.CompactTextString(m) }
func (*Reply) ProtoMessage() {}
func (*Reply) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{1}
+ return fileDescriptor_test_2309d445eee26af7, []int{1}
}
var extRange_Reply = []proto.ExtensionRange{
@@ -393,7 +393,7 @@
func (m *Reply_Entry) String() string { return proto.CompactTextString(m) }
func (*Reply_Entry) ProtoMessage() {}
func (*Reply_Entry) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{1, 0}
+ return fileDescriptor_test_2309d445eee26af7, []int{1, 0}
}
func (m *Reply_Entry) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Reply_Entry.Unmarshal(m, b)
@@ -448,7 +448,7 @@
func (m *OtherBase) String() string { return proto.CompactTextString(m) }
func (*OtherBase) ProtoMessage() {}
func (*OtherBase) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{2}
+ return fileDescriptor_test_2309d445eee26af7, []int{2}
}
var extRange_OtherBase = []proto.ExtensionRange{
@@ -493,7 +493,7 @@
func (m *ReplyExtensions) String() string { return proto.CompactTextString(m) }
func (*ReplyExtensions) ProtoMessage() {}
func (*ReplyExtensions) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{3}
+ return fileDescriptor_test_2309d445eee26af7, []int{3}
}
func (m *ReplyExtensions) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyExtensions.Unmarshal(m, b)
@@ -551,7 +551,7 @@
func (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) }
func (*OtherReplyExtensions) ProtoMessage() {}
func (*OtherReplyExtensions) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{4}
+ return fileDescriptor_test_2309d445eee26af7, []int{4}
}
func (m *OtherReplyExtensions) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OtherReplyExtensions.Unmarshal(m, b)
@@ -589,7 +589,7 @@
func (m *OldReply) String() string { return proto.CompactTextString(m) }
func (*OldReply) ProtoMessage() {}
func (*OldReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{5}
+ return fileDescriptor_test_2309d445eee26af7, []int{5}
}
func (m *OldReply) MarshalJSON() ([]byte, error) {
@@ -649,7 +649,7 @@
func (m *Communique) String() string { return proto.CompactTextString(m) }
func (*Communique) ProtoMessage() {}
func (*Communique) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{6}
+ return fileDescriptor_test_2309d445eee26af7, []int{6}
}
func (m *Communique) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Communique.Unmarshal(m, b)
@@ -698,7 +698,7 @@
Delta int32 `protobuf:"zigzag32,12,opt,name=delta,oneof"`
}
type Communique_Msg struct {
- Msg *Reply `protobuf:"bytes,13,opt,name=msg,oneof"`
+ Msg *Reply `protobuf:"bytes,16,opt,name=msg,oneof"`
}
type Communique_Somegroup struct {
Somegroup *Communique_SomeGroup `protobuf:"group,14,opt,name=SomeGroup,json=somegroup,oneof"`
@@ -848,7 +848,7 @@
b.EncodeVarint(12<<3 | proto.WireVarint)
b.EncodeZigzag32(uint64(x.Delta))
case *Communique_Msg:
- b.EncodeVarint(13<<3 | proto.WireBytes)
+ b.EncodeVarint(16<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Msg); err != nil {
return err
}
@@ -924,7 +924,7 @@
x, err := b.DecodeZigzag32()
m.Union = &Communique_Delta_{int32(x)}
return true, err
- case 13: // union.msg
+ case 16: // union.msg
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
@@ -950,40 +950,40 @@
// union
switch x := m.Union.(type) {
case *Communique_Number:
- n += proto.SizeVarint(5<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.Number))
case *Communique_Name:
- n += proto.SizeVarint(6<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Name)))
n += len(x.Name)
case *Communique_Data:
- n += proto.SizeVarint(7<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Data)))
n += len(x.Data)
case *Communique_TempC:
- n += proto.SizeVarint(8<<3 | proto.WireFixed64)
+ n += 1 // tag and wire
n += 8
case *Communique_Height:
- n += proto.SizeVarint(9<<3 | proto.WireFixed32)
+ n += 1 // tag and wire
n += 4
case *Communique_Today:
- n += proto.SizeVarint(10<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.Today))
case *Communique_Maybe:
- n += proto.SizeVarint(11<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += 1
case *Communique_Delta_:
- n += proto.SizeVarint(12<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64((uint32(x.Delta) << 1) ^ uint32((int32(x.Delta) >> 31))))
case *Communique_Msg:
s := proto.Size(x.Msg)
- n += proto.SizeVarint(13<<3 | proto.WireBytes)
+ n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Communique_Somegroup:
- n += proto.SizeVarint(14<<3 | proto.WireStartGroup)
+ n += 1 // tag and wire
n += proto.Size(x.Somegroup)
- n += proto.SizeVarint(14<<3 | proto.WireEndGroup)
+ n += 1 // tag and wire
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
@@ -1002,7 +1002,7 @@
func (m *Communique_SomeGroup) String() string { return proto.CompactTextString(m) }
func (*Communique_SomeGroup) ProtoMessage() {}
func (*Communique_SomeGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{6, 0}
+ return fileDescriptor_test_2309d445eee26af7, []int{6, 0}
}
func (m *Communique_SomeGroup) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Communique_SomeGroup.Unmarshal(m, b)
@@ -1039,7 +1039,7 @@
func (m *Communique_Delta) String() string { return proto.CompactTextString(m) }
func (*Communique_Delta) ProtoMessage() {}
func (*Communique_Delta) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_4c0531be33cf90ba, []int{6, 1}
+ return fileDescriptor_test_2309d445eee26af7, []int{6, 1}
}
func (m *Communique_Delta) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Communique_Delta.Unmarshal(m, b)
@@ -1102,73 +1102,73 @@
proto.RegisterExtension(E_Donut)
}
-func init() { proto.RegisterFile("my_test/test.proto", fileDescriptor_test_4c0531be33cf90ba) }
+func init() { proto.RegisterFile("my_test/test.proto", fileDescriptor_test_2309d445eee26af7) }
-var fileDescriptor_test_4c0531be33cf90ba = []byte{
- // 1035 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0xdb, 0x6e, 0xdb, 0x46,
- 0x13, 0xd6, 0x92, 0xa2, 0x0e, 0x23, 0xc5, 0xe6, 0xbf, 0x30, 0x6c, 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x6c, 0x22, 0x5c, 0x83, 0xf2, 0xf5, 0xcd, 0xe0, 0x4a, 0x1a, 0x9a, 0x54, 0x8d, 0xcb, 0x9b, 0x71,
- 0xff, 0xc2, 0x44, 0x0d, 0xcd, 0x44, 0x1d, 0x1b, 0x74, 0x41, 0xfd, 0xad, 0x7d, 0xf5, 0xd5, 0x31,
- 0x64, 0xa8, 0xd3, 0xfb, 0x77, 0x25, 0x9f, 0x63, 0x7e, 0x51, 0xdd, 0x79, 0xf9, 0x74, 0x51, 0x3f,
- 0xbf, 0x93, 0xdd, 0xf7, 0x1f, 0xdf, 0xf9, 0x81, 0x98, 0xa5, 0xb7, 0xad, 0x69, 0xc4, 0x4f, 0xfc,
- 0x68, 0x4e, 0x43, 0xff, 0x44, 0x5d, 0x8e, 0xb7, 0xe9, 0x5d, 0xfe, 0x32, 0x7d, 0xed, 0xb3, 0xf0,
- 0xb5, 0x1f, 0xa9, 0x5b, 0x55, 0xee, 0xc3, 0xc9, 0xf2, 0x9a, 0xfd, 0x51, 0x3e, 0xfe, 0x09, 0x00,
- 0x00, 0xff, 0xff, 0x0d, 0xa4, 0x7d, 0x7c, 0x75, 0x07, 0x00, 0x00,
+var fileDescriptor_test_2309d445eee26af7 = []byte{
+ // 1033 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0xdd, 0x6e, 0xe3, 0x44,
+ 0x14, 0xce, 0xd8, 0x71, 0x7e, 0x4e, 0x42, 0x6b, 0x46, 0x55, 0x6b, 0x05, 0xed, 0xd6, 0x04, 0x8a,
+ 0x4c, 0xc5, 0xa6, 0xda, 0x80, 0xc4, 0x2a, 0x88, 0xd5, 0x36, 0x3f, 0x6d, 0xaa, 0x6d, 0x12, 0x69,
+ 0xda, 0x5e, 0xb0, 0x37, 0xd6, 0x34, 0x9e, 0x3a, 0xa6, 0x19, 0x3b, 0x6b, 0x8f, 0x11, 0xbe,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b, 0xfb, 0xea, 0xab, 0x63, 0xc8, 0x50,
+ 0xa7, 0xf7, 0xdf, 0x4a, 0x3e, 0xc7, 0xfc, 0xaa, 0xba, 0xf3, 0xe2, 0xe9, 0xa2, 0xfe, 0xff, 0x4e,
+ 0x76, 0xdf, 0x7d, 0x78, 0xeb, 0x07, 0x62, 0x96, 0xde, 0xb6, 0xa6, 0x11, 0x3f, 0xf1, 0xa3, 0x39,
+ 0x0d, 0xfd, 0x13, 0x75, 0x39, 0xde, 0xa6, 0x77, 0xf9, 0xcb, 0xf4, 0x95, 0xcf, 0xc2, 0x57, 0x7e,
+ 0xa4, 0x6e, 0x55, 0xb9, 0x0f, 0x27, 0xcb, 0x6b, 0xf6, 0x27, 0xf9, 0xf8, 0x37, 0x00, 0x00, 0xff,
+ 0xff, 0x12, 0xd5, 0x46, 0x00, 0x75, 0x07, 0x00, 0x00,
}
diff --git a/protoc-gen-go/testdata/my_test/test.proto b/protoc-gen-go/testdata/my_test/test.proto
index 4f133dc..1ef3fd0 100644
--- a/protoc-gen-go/testdata/my_test/test.proto
+++ b/protoc-gen-go/testdata/my_test/test.proto
@@ -147,7 +147,7 @@
Days today = 10;
bool maybe = 11;
sint32 delta = 12; // name will conflict with Delta below
- Reply msg = 13;
+ Reply msg = 16; // requires two bytes to encode field tag
group SomeGroup = 14 {
optional string member = 15;
}
diff --git a/ptypes/struct/struct.pb.go b/ptypes/struct/struct.pb.go
index 8201c4a..442c0e0 100644
--- a/ptypes/struct/struct.pb.go
+++ b/ptypes/struct/struct.pb.go
@@ -324,26 +324,26 @@
// kind
switch x := m.Kind.(type) {
case *Value_NullValue:
- n += proto.SizeVarint(1<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(x.NullValue))
case *Value_NumberValue:
- n += proto.SizeVarint(2<<3 | proto.WireFixed64)
+ n += 1 // tag and wire
n += 8
case *Value_StringValue:
- n += proto.SizeVarint(3<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.StringValue)))
n += len(x.StringValue)
case *Value_BoolValue:
- n += proto.SizeVarint(4<<3 | proto.WireVarint)
+ n += 1 // tag and wire
n += 1
case *Value_StructValue:
s := proto.Size(x.StructValue)
- n += proto.SizeVarint(5<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Value_ListValue:
s := proto.Size(x.ListValue)
- n += proto.SizeVarint(6<<3 | proto.WireBytes)
+ n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil: