From 95a5bc73bf837f7e0ce2916f006ccb3ae04ed50d Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 22 Nov 2023 10:23:57 -0800 Subject: [PATCH 01/18] Naive add --- Makefile | 3 +- .../test_messages_proto3_vtproto.pb.go | 447 +--- generator/generatedfile.go | 4 + testproto/wkt/wkt.pb.go | 205 +- testproto/wkt/wkt.proto | 5 + testproto/wkt/wkt_vtproto.pb.go | 369 +++ types/known/structpb/struct_vtproto.pb.go | 1969 +++++++++++++++++ 7 files changed, 2567 insertions(+), 435 deletions(-) create mode 100644 types/known/structpb/struct_vtproto.pb.go diff --git a/Makefile b/Makefile index b71fbc9..c524dbb 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,8 @@ gen-wkt: bin/protoc-gen-go-vtproto $(PROTOBUF_ROOT)/src/google/protobuf/empty.proto \ $(PROTOBUF_ROOT)/src/google/protobuf/field_mask.proto \ $(PROTOBUF_ROOT)/src/google/protobuf/timestamp.proto \ - $(PROTOBUF_ROOT)/src/google/protobuf/wrappers.proto + $(PROTOBUF_ROOT)/src/google/protobuf/wrappers.proto \ + $(PROTOBUF_ROOT)/src/google/protobuf/struct.proto gen-testproto: get-grpc-testproto gen-wkt-testproto install $(PROTOBUF_ROOT)/src/protoc \ diff --git a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go index 112590c..8dfdc51 100644 --- a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go @@ -10,6 +10,7 @@ import ( anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" durationpb1 "github.com/planetscale/vtprotobuf/types/known/durationpb" fieldmaskpb1 "github.com/planetscale/vtprotobuf/types/known/fieldmaskpb" + structpb1 "github.com/planetscale/vtprotobuf/types/known/structpb" timestamppb1 "github.com/planetscale/vtprotobuf/types/known/timestamppb" wrapperspb1 "github.com/planetscale/vtprotobuf/types/known/wrapperspb" proto "google.golang.org/protobuf/proto" @@ -89,7 +90,9 @@ func (m *TestAllTypesProto3) CloneVT() *TestAllTypesProto3 { r.OptionalDuration = (*durationpb.Duration)((*durationpb1.Duration)(m.OptionalDuration).CloneVT()) r.OptionalTimestamp = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.OptionalTimestamp).CloneVT()) r.OptionalFieldMask = (*fieldmaskpb.FieldMask)((*fieldmaskpb1.FieldMask)(m.OptionalFieldMask).CloneVT()) + r.OptionalStruct = (*structpb.Struct)((*structpb1.Struct)(m.OptionalStruct).CloneVT()) r.OptionalAny = (*anypb.Any)((*anypb1.Any)(m.OptionalAny).CloneVT()) + r.OptionalValue = (*structpb.Value)((*structpb1.Value)(m.OptionalValue).CloneVT()) r.OptionalNullValue = m.OptionalNullValue r.Fieldname1 = m.Fieldname1 r.FieldName2 = m.FieldName2 @@ -570,20 +573,6 @@ func (m *TestAllTypesProto3) CloneVT() *TestAllTypesProto3 { } r.RepeatedBytesWrapper = tmpContainer } - if rhs := m.OptionalStruct; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *structpb.Struct }); ok { - r.OptionalStruct = vtpb.CloneVT() - } else { - r.OptionalStruct = proto.Clone(rhs).(*structpb.Struct) - } - } - if rhs := m.OptionalValue; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *structpb.Value }); ok { - r.OptionalValue = vtpb.CloneVT() - } else { - r.OptionalValue = proto.Clone(rhs).(*structpb.Value) - } - } if rhs := m.RepeatedDuration; rhs != nil { tmpContainer := make([]*durationpb.Duration, len(rhs)) for k, v := range rhs { @@ -608,11 +597,7 @@ func (m *TestAllTypesProto3) CloneVT() *TestAllTypesProto3 { if rhs := m.RepeatedStruct; rhs != nil { tmpContainer := make([]*structpb.Struct, len(rhs)) for k, v := range rhs { - if vtpb, ok := interface{}(v).(interface{ CloneVT() *structpb.Struct }); ok { - tmpContainer[k] = vtpb.CloneVT() - } else { - tmpContainer[k] = proto.Clone(v).(*structpb.Struct) - } + tmpContainer[k] = (*structpb.Struct)((*structpb1.Struct)(v).CloneVT()) } r.RepeatedStruct = tmpContainer } @@ -626,22 +611,14 @@ func (m *TestAllTypesProto3) CloneVT() *TestAllTypesProto3 { if rhs := m.RepeatedValue; rhs != nil { tmpContainer := make([]*structpb.Value, len(rhs)) for k, v := range rhs { - if vtpb, ok := interface{}(v).(interface{ CloneVT() *structpb.Value }); ok { - tmpContainer[k] = vtpb.CloneVT() - } else { - tmpContainer[k] = proto.Clone(v).(*structpb.Value) - } + tmpContainer[k] = (*structpb.Value)((*structpb1.Value)(v).CloneVT()) } r.RepeatedValue = tmpContainer } if rhs := m.RepeatedListValue; rhs != nil { tmpContainer := make([]*structpb.ListValue, len(rhs)) for k, v := range rhs { - if vtpb, ok := interface{}(v).(interface{ CloneVT() *structpb.ListValue }); ok { - tmpContainer[k] = vtpb.CloneVT() - } else { - tmpContainer[k] = proto.Clone(v).(*structpb.ListValue) - } + tmpContainer[k] = (*structpb.ListValue)((*structpb1.ListValue)(v).CloneVT()) } r.RepeatedListValue = tmpContainer } @@ -1798,21 +1775,13 @@ func (this *TestAllTypesProto3) EqualVT(that *TestAllTypesProto3) bool { if !(*fieldmaskpb1.FieldMask)(this.OptionalFieldMask).EqualVT((*fieldmaskpb1.FieldMask)(that.OptionalFieldMask)) { return false } - if equal, ok := interface{}(this.OptionalStruct).(interface{ EqualVT(*structpb.Struct) bool }); ok { - if !equal.EqualVT(that.OptionalStruct) { - return false - } - } else if !proto.Equal(this.OptionalStruct, that.OptionalStruct) { + if !(*structpb1.Struct)(this.OptionalStruct).EqualVT((*structpb1.Struct)(that.OptionalStruct)) { return false } if !(*anypb1.Any)(this.OptionalAny).EqualVT((*anypb1.Any)(that.OptionalAny)) { return false } - if equal, ok := interface{}(this.OptionalValue).(interface{ EqualVT(*structpb.Value) bool }); ok { - if !equal.EqualVT(that.OptionalValue) { - return false - } - } else if !proto.Equal(this.OptionalValue, that.OptionalValue) { + if !(*structpb1.Value)(this.OptionalValue).EqualVT((*structpb1.Value)(that.OptionalValue)) { return false } if this.OptionalNullValue != that.OptionalNullValue { @@ -1898,11 +1867,7 @@ func (this *TestAllTypesProto3) EqualVT(that *TestAllTypesProto3) bool { if q == nil { q = &structpb.Value{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*structpb.Value) bool }); ok { - if !equal.EqualVT(q) { - return false - } - } else if !proto.Equal(p, q) { + if !(*structpb1.Value)(p).EqualVT((*structpb1.Value)(q)) { return false } } @@ -1919,13 +1884,7 @@ func (this *TestAllTypesProto3) EqualVT(that *TestAllTypesProto3) bool { if q == nil { q = &structpb.ListValue{} } - if equal, ok := interface{}(p).(interface { - EqualVT(*structpb.ListValue) bool - }); ok { - if !equal.EqualVT(q) { - return false - } - } else if !proto.Equal(p, q) { + if !(*structpb1.ListValue)(p).EqualVT((*structpb1.ListValue)(q)) { return false } } @@ -1942,11 +1901,7 @@ func (this *TestAllTypesProto3) EqualVT(that *TestAllTypesProto3) bool { if q == nil { q = &structpb.Struct{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*structpb.Struct) bool }); ok { - if !equal.EqualVT(q) { - return false - } - } else if !proto.Equal(p, q) { + if !(*structpb1.Struct)(p).EqualVT((*structpb1.Struct)(q)) { return false } } @@ -2459,24 +2414,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedStruct) > 0 { for iNdEx := len(m.RepeatedStruct) - 1; iNdEx >= 0; iNdEx-- { - if vtmsg, ok := interface{}(m.RepeatedStruct[iNdEx]).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.RepeatedStruct[iNdEx]) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Struct)(m.RepeatedStruct[iNdEx]).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x14 i-- @@ -2485,24 +2428,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedListValue) > 0 { for iNdEx := len(m.RepeatedListValue) - 1; iNdEx >= 0; iNdEx-- { - if vtmsg, ok := interface{}(m.RepeatedListValue[iNdEx]).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.RepeatedListValue[iNdEx]) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.ListValue)(m.RepeatedListValue[iNdEx]).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2511,24 +2442,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedValue) > 0 { for iNdEx := len(m.RepeatedValue) - 1; iNdEx >= 0; iNdEx-- { - if vtmsg, ok := interface{}(m.RepeatedValue[iNdEx]).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.RepeatedValue[iNdEx]) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Value)(m.RepeatedValue[iNdEx]).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2599,24 +2518,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x98 } if m.OptionalValue != nil { - if vtmsg, ok := interface{}(m.OptionalValue).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.OptionalValue) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Value)(m.OptionalValue).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2635,24 +2542,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x8a } if m.OptionalStruct != nil { - if vtmsg, ok := interface{}(m.OptionalStruct).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.OptionalStruct) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Struct)(m.OptionalStruct).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4653,24 +4548,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedStruct) > 0 { for iNdEx := len(m.RepeatedStruct) - 1; iNdEx >= 0; iNdEx-- { - if vtmsg, ok := interface{}(m.RepeatedStruct[iNdEx]).(interface { - MarshalToSizedBufferVTStrict([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.RepeatedStruct[iNdEx]) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Struct)(m.RepeatedStruct[iNdEx]).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x14 i-- @@ -4679,24 +4562,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedListValue) > 0 { for iNdEx := len(m.RepeatedListValue) - 1; iNdEx >= 0; iNdEx-- { - if vtmsg, ok := interface{}(m.RepeatedListValue[iNdEx]).(interface { - MarshalToSizedBufferVTStrict([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.RepeatedListValue[iNdEx]) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.ListValue)(m.RepeatedListValue[iNdEx]).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4705,24 +4576,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedValue) > 0 { for iNdEx := len(m.RepeatedValue) - 1; iNdEx >= 0; iNdEx-- { - if vtmsg, ok := interface{}(m.RepeatedValue[iNdEx]).(interface { - MarshalToSizedBufferVTStrict([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.RepeatedValue[iNdEx]) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Value)(m.RepeatedValue[iNdEx]).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4793,24 +4652,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0x98 } if m.OptionalValue != nil { - if vtmsg, ok := interface{}(m.OptionalValue).(interface { - MarshalToSizedBufferVTStrict([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.OptionalValue) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Value)(m.OptionalValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4829,24 +4676,12 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0x8a } if m.OptionalStruct != nil { - if vtmsg, ok := interface{}(m.OptionalStruct).(interface { - MarshalToSizedBufferVTStrict([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.OptionalStruct) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + size, err := (*structpb1.Struct)(m.OptionalStruct).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -7318,13 +7153,7 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { n += 2 + l + sov(uint64(l)) } if m.OptionalStruct != nil { - if size, ok := interface{}(m.OptionalStruct).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.OptionalStruct) - } + l = (*structpb1.Struct)(m.OptionalStruct).SizeVT() n += 2 + l + sov(uint64(l)) } if m.OptionalAny != nil { @@ -7332,13 +7161,7 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { n += 2 + l + sov(uint64(l)) } if m.OptionalValue != nil { - if size, ok := interface{}(m.OptionalValue).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.OptionalValue) - } + l = (*structpb1.Value)(m.OptionalValue).SizeVT() n += 2 + l + sov(uint64(l)) } if m.OptionalNullValue != 0 { @@ -7370,37 +7193,19 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { } if len(m.RepeatedValue) > 0 { for _, e := range m.RepeatedValue { - if size, ok := interface{}(e).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(e) - } + l = (*structpb1.Value)(e).SizeVT() n += 2 + l + sov(uint64(l)) } } if len(m.RepeatedListValue) > 0 { for _, e := range m.RepeatedListValue { - if size, ok := interface{}(e).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(e) - } + l = (*structpb1.ListValue)(e).SizeVT() n += 2 + l + sov(uint64(l)) } } if len(m.RepeatedStruct) > 0 { for _, e := range m.RepeatedStruct { - if size, ok := interface{}(e).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(e) - } + l = (*structpb1.Struct)(e).SizeVT() n += 2 + l + sov(uint64(l)) } } @@ -14185,16 +13990,8 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if m.OptionalStruct == nil { m.OptionalStruct = &structpb.Struct{} } - if unmarshal, ok := interface{}(m.OptionalStruct).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.OptionalStruct); err != nil { - return err - } + if err := (*structpb1.Struct)(m.OptionalStruct).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 305: @@ -14265,16 +14062,8 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if m.OptionalValue == nil { m.OptionalValue = &structpb.Value{} } - if unmarshal, ok := interface{}(m.OptionalValue).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.OptionalValue); err != nil { - return err - } + if err := (*structpb1.Value)(m.OptionalValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 307: @@ -14462,16 +14251,8 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } m.RepeatedValue = append(m.RepeatedValue, &structpb.Value{}) - if unmarshal, ok := interface{}(m.RepeatedValue[len(m.RepeatedValue)-1]).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.RepeatedValue[len(m.RepeatedValue)-1]); err != nil { - return err - } + if err := (*structpb1.Value)(m.RepeatedValue[len(m.RepeatedValue)-1]).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 317: @@ -14504,16 +14285,8 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } m.RepeatedListValue = append(m.RepeatedListValue, &structpb.ListValue{}) - if unmarshal, ok := interface{}(m.RepeatedListValue[len(m.RepeatedListValue)-1]).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.RepeatedListValue[len(m.RepeatedListValue)-1]); err != nil { - return err - } + if err := (*structpb1.ListValue)(m.RepeatedListValue[len(m.RepeatedListValue)-1]).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 324: @@ -14546,16 +14319,8 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } m.RepeatedStruct = append(m.RepeatedStruct, &structpb.Struct{}) - if unmarshal, ok := interface{}(m.RepeatedStruct[len(m.RepeatedStruct)-1]).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.RepeatedStruct[len(m.RepeatedStruct)-1]); err != nil { - return err - } + if err := (*structpb1.Struct)(m.RepeatedStruct[len(m.RepeatedStruct)-1]).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 401: @@ -21683,16 +21448,8 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if m.OptionalStruct == nil { m.OptionalStruct = &structpb.Struct{} } - if unmarshal, ok := interface{}(m.OptionalStruct).(interface { - UnmarshalVTUnsafe([]byte) error - }); ok { - if err := unmarshal.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.OptionalStruct); err != nil { - return err - } + if err := (*structpb1.Struct)(m.OptionalStruct).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 305: @@ -21763,16 +21520,8 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if m.OptionalValue == nil { m.OptionalValue = &structpb.Value{} } - if unmarshal, ok := interface{}(m.OptionalValue).(interface { - UnmarshalVTUnsafe([]byte) error - }); ok { - if err := unmarshal.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.OptionalValue); err != nil { - return err - } + if err := (*structpb1.Value)(m.OptionalValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 307: @@ -21960,16 +21709,8 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } m.RepeatedValue = append(m.RepeatedValue, &structpb.Value{}) - if unmarshal, ok := interface{}(m.RepeatedValue[len(m.RepeatedValue)-1]).(interface { - UnmarshalVTUnsafe([]byte) error - }); ok { - if err := unmarshal.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.RepeatedValue[len(m.RepeatedValue)-1]); err != nil { - return err - } + if err := (*structpb1.Value)(m.RepeatedValue[len(m.RepeatedValue)-1]).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 317: @@ -22002,16 +21743,8 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } m.RepeatedListValue = append(m.RepeatedListValue, &structpb.ListValue{}) - if unmarshal, ok := interface{}(m.RepeatedListValue[len(m.RepeatedListValue)-1]).(interface { - UnmarshalVTUnsafe([]byte) error - }); ok { - if err := unmarshal.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.RepeatedListValue[len(m.RepeatedListValue)-1]); err != nil { - return err - } + if err := (*structpb1.ListValue)(m.RepeatedListValue[len(m.RepeatedListValue)-1]).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 324: @@ -22044,16 +21777,8 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } m.RepeatedStruct = append(m.RepeatedStruct, &structpb.Struct{}) - if unmarshal, ok := interface{}(m.RepeatedStruct[len(m.RepeatedStruct)-1]).(interface { - UnmarshalVTUnsafe([]byte) error - }); ok { - if err := unmarshal.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.RepeatedStruct[len(m.RepeatedStruct)-1]); err != nil { - return err - } + if err := (*structpb1.Struct)(m.RepeatedStruct[len(m.RepeatedStruct)-1]).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 401: diff --git a/generator/generatedfile.go b/generator/generatedfile.go index 5c0b5aa..e555831 100644 --- a/generator/generatedfile.go +++ b/generator/generatedfile.go @@ -129,6 +129,10 @@ var wellKnownTypes = map[protoreflect.FullName]protogen.GoIdent{ "google.protobuf.BoolValue": {GoName: "BoolValue", GoImportPath: vtWellKnownPackage + "wrapperspb"}, "google.protobuf.StringValue": {GoName: "StringValue", GoImportPath: vtWellKnownPackage + "wrapperspb"}, "google.protobuf.BytesValue": {GoName: "BytesValue", GoImportPath: vtWellKnownPackage + "wrapperspb"}, + "google.protobuf.Struct": {GoName: "Struct", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.Value": {GoName: "Value", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.ListValue": {GoName: "ListValue", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.NullValue": {GoName: "NullValue", GoImportPath: vtWellKnownPackage + "structpb"}, } func (p *GeneratedFile) IsWellKnownType(message *protogen.Message) bool { diff --git a/testproto/wkt/wkt.pb.go b/testproto/wkt/wkt.pb.go index a20fd0e..02ba6d5 100644 --- a/testproto/wkt/wkt.pb.go +++ b/testproto/wkt/wkt.pb.go @@ -13,6 +13,7 @@ import ( durationpb "google.golang.org/protobuf/types/known/durationpb" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + structpb "google.golang.org/protobuf/types/known/structpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" @@ -31,20 +32,24 @@ type MessageWithWKT struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Any *anypb.Any `protobuf:"bytes,1,opt,name=any,proto3" json:"any,omitempty"` - Duration *durationpb.Duration `protobuf:"bytes,2,opt,name=duration,proto3" json:"duration,omitempty"` - Empty *emptypb.Empty `protobuf:"bytes,3,opt,name=empty,proto3" json:"empty,omitempty"` - FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,4,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - DoubleValue *wrapperspb.DoubleValue `protobuf:"bytes,6,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` - FloatValue *wrapperspb.FloatValue `protobuf:"bytes,7,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` - Int64Value *wrapperspb.Int64Value `protobuf:"bytes,8,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` - Uint64Value *wrapperspb.UInt64Value `protobuf:"bytes,9,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` - Int32Value *wrapperspb.Int32Value `protobuf:"bytes,10,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` - Uint32Value *wrapperspb.UInt32Value `protobuf:"bytes,11,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` - BoolValue *wrapperspb.BoolValue `protobuf:"bytes,12,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` - StringValue *wrapperspb.StringValue `protobuf:"bytes,13,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` - BytesValue *wrapperspb.BytesValue `protobuf:"bytes,14,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` + Any *anypb.Any `protobuf:"bytes,1,opt,name=any,proto3" json:"any,omitempty"` + Duration *durationpb.Duration `protobuf:"bytes,2,opt,name=duration,proto3" json:"duration,omitempty"` + Empty *emptypb.Empty `protobuf:"bytes,3,opt,name=empty,proto3" json:"empty,omitempty"` + FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,4,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + DoubleValue *wrapperspb.DoubleValue `protobuf:"bytes,6,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` + FloatValue *wrapperspb.FloatValue `protobuf:"bytes,7,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` + Int64Value *wrapperspb.Int64Value `protobuf:"bytes,8,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` + Uint64Value *wrapperspb.UInt64Value `protobuf:"bytes,9,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` + Int32Value *wrapperspb.Int32Value `protobuf:"bytes,10,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` + Uint32Value *wrapperspb.UInt32Value `protobuf:"bytes,11,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` + BoolValue *wrapperspb.BoolValue `protobuf:"bytes,12,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` + StringValue *wrapperspb.StringValue `protobuf:"bytes,13,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` + BytesValue *wrapperspb.BytesValue `protobuf:"bytes,14,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` + StructValue *structpb.Struct `protobuf:"bytes,15,opt,name=struct_value,json=structValue,proto3" json:"struct_value,omitempty"` + ValueValue *structpb.Value `protobuf:"bytes,16,opt,name=value_value,json=valueValue,proto3" json:"value_value,omitempty"` + ListvalueValue *structpb.ListValue `protobuf:"bytes,17,opt,name=listvalue_value,json=listvalueValue,proto3" json:"listvalue_value,omitempty"` + NullValue structpb.NullValue `protobuf:"varint,18,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue" json:"null_value,omitempty"` } func (x *MessageWithWKT) Reset() { @@ -177,6 +182,34 @@ func (x *MessageWithWKT) GetBytesValue() *wrapperspb.BytesValue { return nil } +func (x *MessageWithWKT) GetStructValue() *structpb.Struct { + if x != nil { + return x.StructValue + } + return nil +} + +func (x *MessageWithWKT) GetValueValue() *structpb.Value { + if x != nil { + return x.ValueValue + } + return nil +} + +func (x *MessageWithWKT) GetListvalueValue() *structpb.ListValue { + if x != nil { + return x.ListvalueValue + } + return nil +} + +func (x *MessageWithWKT) GetNullValue() structpb.NullValue { + if x != nil { + return x.NullValue + } + return structpb.NullValue_NULL_VALUE +} + var File_wkt_wkt_proto protoreflect.FileDescriptor var file_wkt_wkt_proto_rawDesc = []byte{ @@ -192,61 +225,79 @@ var file_wkt_wkt_proto_rawDesc = []byte{ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x06, 0x0a, 0x0e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x12, 0x26, 0x0a, - 0x03, 0x61, 0x6e, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x03, 0x61, 0x6e, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x05, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x3f, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x3c, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, - 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, + 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, 0x08, 0x0a, 0x0e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x12, 0x26, 0x0a, 0x03, 0x61, + 0x6e, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x03, + 0x61, 0x6e, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x05, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3f, 0x0a, + 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, + 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x0c, - 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, - 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x75, - 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0a, - 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x62, 0x6f, - 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, 0x5a, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x77, 0x6b, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0b, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, + 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x62, 0x6f, + 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x43, 0x0a, 0x0f, 0x6c, 0x69, 0x73, + 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, + 0x6c, 0x69, 0x73, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, + 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, + 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, 0x5a, 0x0d, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x77, 0x6b, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -278,6 +329,10 @@ var file_wkt_wkt_proto_goTypes = []interface{}{ (*wrapperspb.BoolValue)(nil), // 12: google.protobuf.BoolValue (*wrapperspb.StringValue)(nil), // 13: google.protobuf.StringValue (*wrapperspb.BytesValue)(nil), // 14: google.protobuf.BytesValue + (*structpb.Struct)(nil), // 15: google.protobuf.Struct + (*structpb.Value)(nil), // 16: google.protobuf.Value + (*structpb.ListValue)(nil), // 17: google.protobuf.ListValue + (structpb.NullValue)(0), // 18: google.protobuf.NullValue } var file_wkt_wkt_proto_depIdxs = []int32{ 1, // 0: MessageWithWKT.any:type_name -> google.protobuf.Any @@ -294,11 +349,15 @@ var file_wkt_wkt_proto_depIdxs = []int32{ 12, // 11: MessageWithWKT.bool_value:type_name -> google.protobuf.BoolValue 13, // 12: MessageWithWKT.string_value:type_name -> google.protobuf.StringValue 14, // 13: MessageWithWKT.bytes_value:type_name -> google.protobuf.BytesValue - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 15, // 14: MessageWithWKT.struct_value:type_name -> google.protobuf.Struct + 16, // 15: MessageWithWKT.value_value:type_name -> google.protobuf.Value + 17, // 16: MessageWithWKT.listvalue_value:type_name -> google.protobuf.ListValue + 18, // 17: MessageWithWKT.null_value:type_name -> google.protobuf.NullValue + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_wkt_wkt_proto_init() } diff --git a/testproto/wkt/wkt.proto b/testproto/wkt/wkt.proto index c3f3270..9e6b058 100644 --- a/testproto/wkt/wkt.proto +++ b/testproto/wkt/wkt.proto @@ -7,6 +7,7 @@ import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; +import "google/protobuf/struct.proto"; message MessageWithWKT { google.protobuf.Any any = 1; @@ -23,4 +24,8 @@ message MessageWithWKT { google.protobuf.BoolValue bool_value = 12; google.protobuf.StringValue string_value = 13; google.protobuf.BytesValue bytes_value = 14; + google.protobuf.Struct struct_value = 15; + google.protobuf.Value value_value = 16; + google.protobuf.ListValue listvalue_value = 17; + google.protobuf.NullValue null_value = 18; } diff --git a/testproto/wkt/wkt_vtproto.pb.go b/testproto/wkt/wkt_vtproto.pb.go index 7f83b5f..1fb40f8 100644 --- a/testproto/wkt/wkt_vtproto.pb.go +++ b/testproto/wkt/wkt_vtproto.pb.go @@ -10,6 +10,7 @@ import ( durationpb1 "github.com/planetscale/vtprotobuf/types/known/durationpb" emptypb1 "github.com/planetscale/vtprotobuf/types/known/emptypb" fieldmaskpb1 "github.com/planetscale/vtprotobuf/types/known/fieldmaskpb" + structpb1 "github.com/planetscale/vtprotobuf/types/known/structpb" timestamppb1 "github.com/planetscale/vtprotobuf/types/known/timestamppb" wrapperspb1 "github.com/planetscale/vtprotobuf/types/known/wrapperspb" proto "google.golang.org/protobuf/proto" @@ -18,6 +19,7 @@ import ( durationpb "google.golang.org/protobuf/types/known/durationpb" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + structpb "google.golang.org/protobuf/types/known/structpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" io "io" @@ -50,6 +52,10 @@ func (m *MessageWithWKT) CloneVT() *MessageWithWKT { r.BoolValue = (*wrapperspb.BoolValue)((*wrapperspb1.BoolValue)(m.BoolValue).CloneVT()) r.StringValue = (*wrapperspb.StringValue)((*wrapperspb1.StringValue)(m.StringValue).CloneVT()) r.BytesValue = (*wrapperspb.BytesValue)((*wrapperspb1.BytesValue)(m.BytesValue).CloneVT()) + r.StructValue = (*structpb.Struct)((*structpb1.Struct)(m.StructValue).CloneVT()) + r.ValueValue = (*structpb.Value)((*structpb1.Value)(m.ValueValue).CloneVT()) + r.ListvalueValue = (*structpb.ListValue)((*structpb1.ListValue)(m.ListvalueValue).CloneVT()) + r.NullValue = m.NullValue if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -109,6 +115,18 @@ func (this *MessageWithWKT) EqualVT(that *MessageWithWKT) bool { if !(*wrapperspb1.BytesValue)(this.BytesValue).EqualVT((*wrapperspb1.BytesValue)(that.BytesValue)) { return false } + if !(*structpb1.Struct)(this.StructValue).EqualVT((*structpb1.Struct)(that.StructValue)) { + return false + } + if !(*structpb1.Value)(this.ValueValue).EqualVT((*structpb1.Value)(that.ValueValue)) { + return false + } + if !(*structpb1.ListValue)(this.ListvalueValue).EqualVT((*structpb1.ListValue)(that.ListvalueValue)) { + return false + } + if this.NullValue != that.NullValue { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -149,6 +167,47 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.NullValue != 0 { + i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.ListvalueValue != nil { + size, err := (*structpb1.ListValue)(m.ListvalueValue).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.ValueValue != nil { + size, err := (*structpb1.Value)(m.ValueValue).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.StructValue != nil { + size, err := (*structpb1.Struct)(m.StructValue).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x7a + } if m.BytesValue != nil { size, err := (*wrapperspb1.BytesValue)(m.BytesValue).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -333,6 +392,47 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.NullValue != 0 { + i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.ListvalueValue != nil { + size, err := (*structpb1.ListValue)(m.ListvalueValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.ValueValue != nil { + size, err := (*structpb1.Value)(m.ValueValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.StructValue != nil { + size, err := (*structpb1.Struct)(m.StructValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x7a + } if m.BytesValue != nil { size, err := (*wrapperspb1.BytesValue)(m.BytesValue).MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { @@ -538,6 +638,21 @@ func (m *MessageWithWKT) SizeVT() (n int) { l = (*wrapperspb1.BytesValue)(m.BytesValue).SizeVT() n += 1 + l + sov(uint64(l)) } + if m.StructValue != nil { + l = (*structpb1.Struct)(m.StructValue).SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.ValueValue != nil { + l = (*structpb1.Value)(m.ValueValue).SizeVT() + n += 2 + l + sov(uint64(l)) + } + if m.ListvalueValue != nil { + l = (*structpb1.ListValue)(m.ListvalueValue).SizeVT() + n += 2 + l + sov(uint64(l)) + } + if m.NullValue != 0 { + n += 2 + sov(uint64(m.NullValue)) + } n += len(m.unknownFields) return n } @@ -1081,6 +1196,133 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StructValue == nil { + m.StructValue = &structpb.Struct{} + } + if err := (*structpb1.Struct)(m.StructValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValueValue == nil { + m.ValueValue = &structpb.Value{} + } + if err := (*structpb1.Value)(m.ValueValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListvalueValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ListvalueValue == nil { + m.ListvalueValue = &structpb.ListValue{} + } + if err := (*structpb1.ListValue)(m.ListvalueValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) + } + m.NullValue = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NullValue |= structpb.NullValue(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -1722,6 +1964,133 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { return err } iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StructValue == nil { + m.StructValue = &structpb.Struct{} + } + if err := (*structpb1.Struct)(m.StructValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValueValue == nil { + m.ValueValue = &structpb.Value{} + } + if err := (*structpb1.Value)(m.ValueValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListvalueValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ListvalueValue == nil { + m.ListvalueValue = &structpb.ListValue{} + } + if err := (*structpb1.ListValue)(m.ListvalueValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) + } + m.NullValue = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NullValue |= structpb.NullValue(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go new file mode 100644 index 0000000..159ade6 --- /dev/null +++ b/types/known/structpb/struct_vtproto.pb.go @@ -0,0 +1,1969 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: (devel) +// source: google/protobuf/struct.proto + +package structpb + +import ( + binary "encoding/binary" + fmt "fmt" + structpb1 "github.com/planetscale/vtprotobuf/types/known/structpb" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + io "io" + math "math" + bits "math/bits" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Struct structpb.Struct +type Value structpb.Value +type ListValue structpb.ListValue +type Value_NullValue structpb.ListValue + +func (m *Struct) CloneVT() *Struct { + if m == nil { + return (*Struct)(nil) + } + r := new(Struct) + if rhs := m.Fields; rhs != nil { + tmpContainer := make(map[string]*structpb.Value, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Fields = tmpContainer + } + return r +} + +func (m *Value) CloneVT() *Value { + if m == nil { + return (*Value)(nil) + } + r := new(Value) + if m.Kind != nil { + r.Kind = m.Kind.(interface{ CloneVT() isValue_Kind }).CloneVT() + } + return r +} + +func (m *Value_NullValue) CloneVT() isValue_Kind { + if m == nil { + return (*Value_NullValue)(nil) + } + r := new(Value_NullValue) + r.NullValue = m.NullValue + return r +} + +func (m *Value_NumberValue) CloneVT() isValue_Kind { + if m == nil { + return (*Value_NumberValue)(nil) + } + r := new(Value_NumberValue) + r.NumberValue = m.NumberValue + return r +} + +func (m *Value_StringValue) CloneVT() isValue_Kind { + if m == nil { + return (*Value_StringValue)(nil) + } + r := new(Value_StringValue) + r.StringValue = m.StringValue + return r +} + +func (m *Value_BoolValue) CloneVT() isValue_Kind { + if m == nil { + return (*Value_BoolValue)(nil) + } + r := new(Value_BoolValue) + r.BoolValue = m.BoolValue + return r +} + +func (m *Value_StructValue) CloneVT() isValue_Kind { + if m == nil { + return (*Value_StructValue)(nil) + } + r := new(Value_StructValue) + r.StructValue = m.StructValue.CloneVT() + return r +} + +func (m *Value_ListValue) CloneVT() isValue_Kind { + if m == nil { + return (*Value_ListValue)(nil) + } + r := new(Value_ListValue) + r.ListValue = m.ListValue.CloneVT() + return r +} + +func (m *ListValue) CloneVT() *ListValue { + if m == nil { + return (*ListValue)(nil) + } + r := new(ListValue) + if rhs := m.Values; rhs != nil { + tmpContainer := make([]*structpb.Value, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Values = tmpContainer + } + return r +} + +func (this *Struct) EqualVT(that *Struct) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Fields) != len(that.Fields) { + return false + } + for i, vx := range this.Fields { + vy, ok := that.Fields[i] + if !ok { + return false + } + if p, q := vx, vy; p != q { + if p == nil { + p = &structpb.Value{} + } + if q == nil { + q = &structpb.Value{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *Value) EqualVT(that *Value) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Kind == nil && that.Kind != nil { + return false + } else if this.Kind != nil { + if that.Kind == nil { + return false + } + if !this.Kind.(interface{ EqualVT(isValue_Kind) bool }).EqualVT(that.Kind) { + return false + } + } + return true +} + +func (this *Value_NullValue) EqualVT(thatIface isValue_Kind) bool { + that, ok := thatIface.(*Value_NullValue) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.NullValue != that.NullValue { + return false + } + return true +} + +func (this *Value_NumberValue) EqualVT(thatIface isValue_Kind) bool { + that, ok := thatIface.(*Value_NumberValue) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.NumberValue != that.NumberValue { + return false + } + return true +} + +func (this *Value_StringValue) EqualVT(thatIface isValue_Kind) bool { + that, ok := thatIface.(*Value_StringValue) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.StringValue != that.StringValue { + return false + } + return true +} + +func (this *Value_BoolValue) EqualVT(thatIface isValue_Kind) bool { + that, ok := thatIface.(*Value_BoolValue) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.BoolValue != that.BoolValue { + return false + } + return true +} + +func (this *Value_StructValue) EqualVT(thatIface isValue_Kind) bool { + that, ok := thatIface.(*Value_StructValue) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.StructValue, that.StructValue; p != q { + if p == nil { + p = &structpb.Struct{} + } + if q == nil { + q = &structpb.Struct{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Value_ListValue) EqualVT(thatIface isValue_Kind) bool { + that, ok := thatIface.(*Value_ListValue) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.ListValue, that.ListValue; p != q { + if p == nil { + p = &structpb.ListValue{} + } + if q == nil { + q = &structpb.ListValue{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *ListValue) EqualVT(that *ListValue) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Values) != len(that.Values) { + return false + } + for i, vx := range this.Values { + vy := that.Values[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &structpb.Value{} + } + if q == nil { + q = &structpb.Value{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (m *Struct) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Struct) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Struct) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fields) > 0 { + for k := range m.Fields { + v := m.Fields[k] + baseI := i + size, err := (*structpb.Value)(v).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Value) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Value) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Kind.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *Value_NullValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_NullValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *Value_NumberValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_NumberValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.NumberValue)))) + i-- + dAtA[i] = 0x11 + return len(dAtA) - i, nil +} +func (m *Value_StringValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_StringValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.StringValue) + copy(dAtA[i:], m.StringValue) + i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *Value_BoolValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_BoolValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.BoolValue { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} +func (m *Value_StructValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_StructValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.StructValue != nil { + size, err := (*structpb1.Struct)(m.StructValue).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Value_ListValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ListValue != nil { + size, err := (*structpb1.ListValue)(m.ListValue).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ListValue) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + size, err := (*structpb1.Value)(m.Values[iNdEx]).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarint(dAtA []byte, offset int, v uint64) int { + offset -= sov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Struct) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Struct) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Struct) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fields) > 0 { + for k := range m.Fields { + v := m.Fields[k] + baseI := i + size, err := (*structpb1.Value)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Value) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Value) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Value) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if msg, ok := m.Kind.(*Value_ListValue); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Kind.(*Value_StructValue); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Kind.(*Value_BoolValue); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Kind.(*Value_StringValue); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Kind.(*Value_NumberValue); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Kind.(*Value_NullValue); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *Value_NullValue) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Value_NullValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *Value_NumberValue) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Value_NumberValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.NumberValue)))) + i-- + dAtA[i] = 0x11 + return len(dAtA) - i, nil +} +func (m *Value_StringValue) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Value_StringValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.StringValue) + copy(dAtA[i:], m.StringValue) + i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *Value_BoolValue) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Value_BoolValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.BoolValue { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} +func (m *Value_StructValue) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Value_StructValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.StructValue != nil { + size, err := (*structpb1.Struct)(m.StructValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Value_ListValue) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Value_ListValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ListValue != nil { + size, err := (*structpb1.ListValue)(m.ListValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ListValue) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListValue) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ListValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + size, err := (*structpb1.Value)(m.Values[iNdEx]).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Struct) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Fields) > 0 { + for k, v := range m.Fields { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + sov(uint64(l)) + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + return n +} + +func (m *Value) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Kind.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *structpb.Value_NullValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sov(uint64(m.NullValue)) + return n +} +func (m *structpb.Value_NumberValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 9 + return n +} +func (m *structpb.Value_StringValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.StringValue) + n += 1 + l + sov(uint64(l)) + return n +} +func (m *structpb.Value_BoolValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} +func (m *structpb.Value_StructValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StructValue != nil { + l = m.StructValue.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *structpb.Value_ListValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ListValue != nil { + l = m.ListValue.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *ListValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Values) > 0 { + for _, e := range m.Values { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + return n +} + +func sov(x uint64) (n int) { + return (bits.Len64(x|1) + 6) / 7 +} +func soz(x uint64) (n int) { + return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Struct) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Struct: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Struct: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fields == nil { + m.Fields = make(map[string]*structpb.Value) + } + var mapkey string + var mapvalue *structpb.Value + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &structpb.Value{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Fields[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Value) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Value: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) + } + var v structpb.NullValue + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= structpb.NullValue(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Kind = &structpb.Value_NullValue{NullValue: v} + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NumberValue", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Kind = &structpb.Value_NumberValue{NumberValue: float64(math.Float64frombits(v))} + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = &structpb.Value_StringValue{StringValue: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Kind = &structpb.Value_BoolValue{BoolValue: b} + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Kind.(*structpb.Value_StructValue); ok { + if err := oneof.StructValue.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.Struct{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &structpb.Value_StructValue{StructValue: v} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Kind.(*structpb.Value_ListValue); ok { + if err := oneof.ListValue.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.ListValue{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &structpb.Value_ListValue{ListValue: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListValue) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, &structpb.Value{}) + if err := m.Values[len(m.Values)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skip(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLength + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroup + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLength + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflow = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") +) + +func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Struct: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Struct: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fields == nil { + m.Fields = make(map[string]*structpb.Value) + } + var mapkey string + var mapvalue *structpb.Value + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &structpb.Value{} + if err := mapvalue.UnmarshalVTUnsafe(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Fields[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Value: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) + } + var v structpb.NullValue + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= structpb.NullValue(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Kind = &structpb.Value_NullValue{NullValue: v} + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NumberValue", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Kind = &structpb.Value_NumberValue{NumberValue: float64(math.Float64frombits(v))} + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = &structpb.Value_StringValue{StringValue: unsafe.String(&dAtA[iNdEx], intStringLen)} + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Kind = &structpb.Value_BoolValue{BoolValue: b} + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Kind.(*structpb.Value_StructValue); ok { + if err := oneof.StructValue.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.Struct{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &structpb.Value_StructValue{StructValue: v} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Kind.(*structpb.Value_ListValue); ok { + if err := oneof.ListValue.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.ListValue{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &structpb.Value_ListValue{ListValue: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListValue) UnmarshalVTUnsafe(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, &structpb.Value{}) + if err := m.Values[len(m.Values)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} From 51fbad00e97313f0bba900e2528442bc48627c3b Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 22 Nov 2023 11:01:47 -0800 Subject: [PATCH 02/18] Fixup cloning --- features/clone/clone.go | 47 ++++++++++++------ generator/generatedfile.go | 38 ++++++++++++++- generator/generator.go | 5 ++ types/known/structpb/struct_vtproto.pb.go | 59 +++++++++++++++-------- types/known/structpb/temp.go | 4 ++ 5 files changed, 116 insertions(+), 37 deletions(-) create mode 100644 types/known/structpb/temp.go diff --git a/features/clone/clone.go b/features/clone/clone.go index 3683c35..7955ebf 100644 --- a/features/clone/clone.go +++ b/features/clone/clone.go @@ -58,7 +58,16 @@ func (p *clone) cloneOneofField(lhsBase, rhsBase string, oneof *protogen.Oneof) lhs := lhsBase + "." + fieldname rhs := rhsBase + "." + fieldname p.P(`if `, rhs, ` != nil {`) - p.P(lhs, ` = `, rhs, `.(interface{ `, cloneName, `() `, ccInterfaceName, ` }).`, cloneName, `()`) + if p.IsWellKnownType(oneof.Parent) { + p.P(`switch c := `, rhs, `.(type) {`) + for _, f := range oneof.Fields { + p.P(`case *`, f.GoIdent, `:`) + p.P(lhs, `= (*`, f.GoIdent, `)((*`, p.WellKnownFieldMap(f), `)(c).`, cloneName, `())`) + } + p.P(`}`) + } else { + p.P(lhs, ` = `, rhs, `.(interface{ `, cloneName, `() `, ccInterfaceName, ` }).`, cloneName, `()`) + } p.P(`}`) } @@ -67,10 +76,10 @@ func (p *clone) cloneFieldSingular(lhs, rhs string, kind protoreflect.Kind, mess switch { case kind == protoreflect.MessageKind, kind == protoreflect.GroupKind: switch { - case p.IsLocalMessage(message): - p.P(lhs, ` = `, rhs, `.`, cloneName, `()`) case p.IsWellKnownType(message): p.P(lhs, ` = (*`, message.GoIdent, `)((*`, p.WellKnownTypeMap(message), `)(`, rhs, `).`, cloneName, `())`) + case p.IsLocalMessage(message): + p.P(lhs, ` = `, rhs, `.`, cloneName, `()`) default: // rhs is a concrete type, we need to first convert it to an interface in order to use an interface // type assertion. @@ -198,13 +207,12 @@ func (p *clone) body(allFieldsNullable bool, ccTypeName string, message *protoge // nil-safe. if field.Desc.Cardinality() != protoreflect.Repeated { switch { - case p.IsLocalMessage(field.Message): - p.P(`r.`, field.GoName, ` = m.`, field.GoName, `.`, cloneName, `()`) - continue - case p.IsWellKnownType(field.Message): p.P(`r.`, field.GoName, ` = (*`, field.Message.GoIdent, `)((*`, p.WellKnownTypeMap(field.Message), `)(m.`, field.GoName, `).`, cloneName, `())`) continue + case p.IsLocalMessage(field.Message): + p.P(`r.`, field.GoName, ` = m.`, field.GoName, `.`, cloneName, `()`) + continue } } refFields = append(refFields, field) @@ -243,10 +251,17 @@ func (p *clone) bodyForOneOf(ccTypeName string, field *protogen.Field) { } // Shortcut: for types where we know that an optimized clone method exists, we can call it directly as it is // nil-safe. - if field.Desc.Cardinality() != protoreflect.Repeated && field.Message != nil && p.IsLocalMessage(field.Message) { - p.P(`r.`, field.GoName, ` = m.`, field.GoName, `.`, cloneName, `()`) - p.P(`return r`) - return + if field.Desc.Cardinality() != protoreflect.Repeated && field.Message != nil { + switch { + case p.IsWellKnownType(field.Message): + p.P(`r.`, field.GoName, ` = (*`, field.Message.GoIdent, `)((*`, p.WellKnownTypeMap(field.Message), `)(m.`, field.GoName, `).`, cloneName, `())`) + p.P(`return r`) + return + case p.IsLocalMessage(field.Message): + p.P(`r.`, field.GoName, ` = m.`, field.GoName, `.`, cloneName, `()`) + p.P(`return r`) + return + } } // Generate explicit assignment statements for reference field. @@ -257,10 +272,14 @@ func (p *clone) bodyForOneOf(ccTypeName string, field *protogen.Field) { // generateCloneMethodsForOneof generates the clone method for the oneof wrapper type of a // field in a oneof. -func (p *clone) generateCloneMethodsForOneof(field *protogen.Field) { +func (p *clone) generateCloneMethodsForOneof(message *protogen.Message, field *protogen.Field) { ccTypeName := field.GoIdent.GoName ccInterfaceName := "is" + field.Oneof.GoIdent.GoName - p.P(`func (m *`, ccTypeName, `) `, cloneName, `() `, ccInterfaceName, ` {`) + if p.IsWellKnownType(message) { + p.P(`func (m *`, ccTypeName, `) `, cloneName, `() *`, ccTypeName, ` {`) + } else { + p.P(`func (m *`, ccTypeName, `) `, cloneName, `() `, ccInterfaceName, ` {`) + } // Create a "fake" field for the single oneof member, pretending it is not a oneof field. fieldInOneof := *field @@ -276,7 +295,7 @@ func (p *clone) processMessageOneofs(message *protogen.Message) { if field.Oneof == nil || field.Oneof.Desc.IsSynthetic() { continue } - p.generateCloneMethodsForOneof(field) + p.generateCloneMethodsForOneof(message, field) } } diff --git a/generator/generatedfile.go b/generator/generatedfile.go index e555831..f51d3e7 100644 --- a/generator/generatedfile.go +++ b/generator/generatedfile.go @@ -112,6 +112,14 @@ func (p *GeneratedFile) IsLocalMessage(message *protogen.Message) bool { return p.LocalPackages[pkg] } +func (p *GeneratedFile) IsLocalField(field *protogen.Field) bool { + if field == nil { + return false + } + pkg := field.Desc.ParentFile().Package() + return p.LocalPackages[pkg] +} + const vtWellKnownPackage = protogen.GoImportPath("github.com/planetscale/vtprotobuf/types/known/") var wellKnownTypes = map[protoreflect.FullName]protogen.GoIdent{ @@ -132,7 +140,15 @@ var wellKnownTypes = map[protoreflect.FullName]protogen.GoIdent{ "google.protobuf.Struct": {GoName: "Struct", GoImportPath: vtWellKnownPackage + "structpb"}, "google.protobuf.Value": {GoName: "Value", GoImportPath: vtWellKnownPackage + "structpb"}, "google.protobuf.ListValue": {GoName: "ListValue", GoImportPath: vtWellKnownPackage + "structpb"}, - "google.protobuf.NullValue": {GoName: "NullValue", GoImportPath: vtWellKnownPackage + "structpb"}, +} + +var wellKnownFields = map[protoreflect.FullName]protogen.GoIdent{ + "google.protobuf.Value.null_value": {GoName: "Value_NullValue", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.Value.number_value": {GoName: "Value_NumberValue", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.Value.string_value": {GoName: "Value_StringValue", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.Value.bool_value": {GoName: "Value_BoolValue", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.Value.struct_value": {GoName: "Value_StructValue", GoImportPath: vtWellKnownPackage + "structpb"}, + "google.protobuf.Value.list_value": {GoName: "Value_ListValue", GoImportPath: vtWellKnownPackage + "structpb"}, } func (p *GeneratedFile) IsWellKnownType(message *protogen.Message) bool { @@ -143,11 +159,29 @@ func (p *GeneratedFile) IsWellKnownType(message *protogen.Message) bool { return ok } +func (p *GeneratedFile) WellKnownFieldMap(field *protogen.Field) protogen.GoIdent { + if field == nil || !p.Config.WellKnownTypes { + return protogen.GoIdent{} + } + res, ff := wellKnownFields[field.Desc.FullName()] + if !ff { + panic(field.Desc.FullName()) + } + if p.IsLocalField(field) { + res.GoImportPath = "" + } + return res +} + func (p *GeneratedFile) WellKnownTypeMap(message *protogen.Message) protogen.GoIdent { if message == nil || !p.Config.WellKnownTypes { return protogen.GoIdent{} } - return wellKnownTypes[message.Desc.FullName()] + res := wellKnownTypes[message.Desc.FullName()] + if p.IsLocalMessage(message) { + res.GoImportPath = "" + } + return res } func (p *GeneratedFile) Wrapper() bool { diff --git a/generator/generator.go b/generator/generator.go index d3afaa2..5f4cdbb 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -127,6 +127,11 @@ func (gen *Generator) generateFile(gf *protogen.GeneratedFile, file *protogen.Fi if p.Wrapper() { for _, msg := range file.Messages { p.P(`type `, msg.GoIdent.GoName, ` `, msg.GoIdent) + for _, one := range msg.Oneofs { + for _, field := range one.Fields { + p.P(`type `, field.GoIdent.GoName, ` `, field.GoIdent) + } + } } } diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go index 159ade6..3fe3929 100644 --- a/types/known/structpb/struct_vtproto.pb.go +++ b/types/known/structpb/struct_vtproto.pb.go @@ -7,7 +7,6 @@ package structpb import ( binary "encoding/binary" fmt "fmt" - structpb1 "github.com/planetscale/vtprotobuf/types/known/structpb" protoimpl "google.golang.org/protobuf/runtime/protoimpl" structpb "google.golang.org/protobuf/types/known/structpb" io "io" @@ -25,8 +24,13 @@ const ( type Struct structpb.Struct type Value structpb.Value +type Value_NullValue structpb.Value_NullValue +type Value_NumberValue structpb.Value_NumberValue +type Value_StringValue structpb.Value_StringValue +type Value_BoolValue structpb.Value_BoolValue +type Value_StructValue structpb.Value_StructValue +type Value_ListValue structpb.Value_ListValue type ListValue structpb.ListValue -type Value_NullValue structpb.ListValue func (m *Struct) CloneVT() *Struct { if m == nil { @@ -36,7 +40,7 @@ func (m *Struct) CloneVT() *Struct { if rhs := m.Fields; rhs != nil { tmpContainer := make(map[string]*structpb.Value, len(rhs)) for k, v := range rhs { - tmpContainer[k] = v.CloneVT() + tmpContainer[k] = (*structpb.Value)((*Value)(v).CloneVT()) } r.Fields = tmpContainer } @@ -49,12 +53,25 @@ func (m *Value) CloneVT() *Value { } r := new(Value) if m.Kind != nil { - r.Kind = m.Kind.(interface{ CloneVT() isValue_Kind }).CloneVT() + switch c := m.Kind.(type) { + case *structpb.Value_NullValue: + r.Kind = (*structpb.Value_NullValue)((*Value_NullValue)(c).CloneVT()) + case *structpb.Value_NumberValue: + r.Kind = (*structpb.Value_NumberValue)((*Value_NumberValue)(c).CloneVT()) + case *structpb.Value_StringValue: + r.Kind = (*structpb.Value_StringValue)((*Value_StringValue)(c).CloneVT()) + case *structpb.Value_BoolValue: + r.Kind = (*structpb.Value_BoolValue)((*Value_BoolValue)(c).CloneVT()) + case *structpb.Value_StructValue: + r.Kind = (*structpb.Value_StructValue)((*Value_StructValue)(c).CloneVT()) + case *structpb.Value_ListValue: + r.Kind = (*structpb.Value_ListValue)((*Value_ListValue)(c).CloneVT()) + } } return r } -func (m *Value_NullValue) CloneVT() isValue_Kind { +func (m *Value_NullValue) CloneVT() *Value_NullValue { if m == nil { return (*Value_NullValue)(nil) } @@ -63,7 +80,7 @@ func (m *Value_NullValue) CloneVT() isValue_Kind { return r } -func (m *Value_NumberValue) CloneVT() isValue_Kind { +func (m *Value_NumberValue) CloneVT() *Value_NumberValue { if m == nil { return (*Value_NumberValue)(nil) } @@ -72,7 +89,7 @@ func (m *Value_NumberValue) CloneVT() isValue_Kind { return r } -func (m *Value_StringValue) CloneVT() isValue_Kind { +func (m *Value_StringValue) CloneVT() *Value_StringValue { if m == nil { return (*Value_StringValue)(nil) } @@ -81,7 +98,7 @@ func (m *Value_StringValue) CloneVT() isValue_Kind { return r } -func (m *Value_BoolValue) CloneVT() isValue_Kind { +func (m *Value_BoolValue) CloneVT() *Value_BoolValue { if m == nil { return (*Value_BoolValue)(nil) } @@ -90,21 +107,21 @@ func (m *Value_BoolValue) CloneVT() isValue_Kind { return r } -func (m *Value_StructValue) CloneVT() isValue_Kind { +func (m *Value_StructValue) CloneVT() *Value_StructValue { if m == nil { return (*Value_StructValue)(nil) } r := new(Value_StructValue) - r.StructValue = m.StructValue.CloneVT() + r.StructValue = (*structpb.Struct)((*Struct)(m.StructValue).CloneVT()) return r } -func (m *Value_ListValue) CloneVT() isValue_Kind { +func (m *Value_ListValue) CloneVT() *Value_ListValue { if m == nil { return (*Value_ListValue)(nil) } r := new(Value_ListValue) - r.ListValue = m.ListValue.CloneVT() + r.ListValue = (*structpb.ListValue)((*ListValue)(m.ListValue).CloneVT()) return r } @@ -116,7 +133,7 @@ func (m *ListValue) CloneVT() *ListValue { if rhs := m.Values; rhs != nil { tmpContainer := make([]*structpb.Value, len(rhs)) for k, v := range rhs { - tmpContainer[k] = v.CloneVT() + tmpContainer[k] = (*structpb.Value)((*Value)(v).CloneVT()) } r.Values = tmpContainer } @@ -345,7 +362,7 @@ func (m *Struct) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.Fields { v := m.Fields[k] baseI := i - size, err := (*structpb.Value)(v).MarshalToSizedBufferVT(dAtA[:i]) + size, err := (*Value)(v).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -468,7 +485,7 @@ func (m *Value_StructValue) MarshalToVT(dAtA []byte) (int, error) { func (m *Value_StructValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.StructValue != nil { - size, err := (*structpb1.Struct)(m.StructValue).MarshalToSizedBufferVT(dAtA[:i]) + size, err := (*Struct)(m.StructValue).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -487,7 +504,7 @@ func (m *Value_ListValue) MarshalToVT(dAtA []byte) (int, error) { func (m *Value_ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.ListValue != nil { - size, err := (*structpb1.ListValue)(m.ListValue).MarshalToSizedBufferVT(dAtA[:i]) + size, err := (*ListValue)(m.ListValue).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -526,7 +543,7 @@ func (m *ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { _ = l if len(m.Values) > 0 { for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - size, err := (*structpb1.Value)(m.Values[iNdEx]).MarshalToSizedBufferVT(dAtA[:i]) + size, err := (*Value)(m.Values[iNdEx]).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -580,7 +597,7 @@ func (m *Struct) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for k := range m.Fields { v := m.Fields[k] baseI := i - size, err := (*structpb1.Value)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) + size, err := (*Value)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } @@ -736,7 +753,7 @@ func (m *Value_StructValue) MarshalToVTStrict(dAtA []byte) (int, error) { func (m *Value_StructValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) if m.StructValue != nil { - size, err := (*structpb1.Struct)(m.StructValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + size, err := (*Struct)(m.StructValue).MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } @@ -755,7 +772,7 @@ func (m *Value_ListValue) MarshalToVTStrict(dAtA []byte) (int, error) { func (m *Value_ListValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) if m.ListValue != nil { - size, err := (*structpb1.ListValue)(m.ListValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + size, err := (*ListValue)(m.ListValue).MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } @@ -794,7 +811,7 @@ func (m *ListValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { _ = l if len(m.Values) > 0 { for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - size, err := (*structpb1.Value)(m.Values[iNdEx]).MarshalToSizedBufferVTStrict(dAtA[:i]) + size, err := (*Value)(m.Values[iNdEx]).MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } diff --git a/types/known/structpb/temp.go b/types/known/structpb/temp.go new file mode 100644 index 0000000..3415a85 --- /dev/null +++ b/types/known/structpb/temp.go @@ -0,0 +1,4 @@ +package structpb + +type isValue_Kind interface { +} From 7c6de23c6ada87f2e76ae4d6a9784e6700dc88a3 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 22 Nov 2023 11:18:42 -0800 Subject: [PATCH 03/18] Equal and Size --- features/equal/equal.go | 8 +++---- features/size/size.go | 9 +++++--- types/known/structpb/struct_vtproto.pb.go | 28 +++++++++++------------ 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/features/equal/equal.go b/features/equal/equal.go index 03cbe02..facbc3c 100644 --- a/features/equal/equal.go +++ b/features/equal/equal.go @@ -249,15 +249,15 @@ func (p *equal) compareCall(lhs, rhs string, msg *protogen.Message, nullable boo lhs, rhs = "p", "q" } switch { - case p.IsLocalMessage(msg): - p.P(`if !`, lhs, `.`, equalName, `(`, rhs, `) {`) - p.P(` return false`) - p.P(`}`) case p.IsWellKnownType(msg): wkt := p.WellKnownTypeMap(msg) p.P(`if !(*`, wkt, `)(`, lhs, `).`, equalName, `((*`, wkt, `)(`, rhs, `)) {`) p.P(` return false`) p.P(`}`) + case p.IsLocalMessage(msg): + p.P(`if !`, lhs, `.`, equalName, `(`, rhs, `) {`) + p.P(` return false`) + p.P(`}`) default: p.P(`if equal, ok := interface{}(`, lhs, `).(interface { `, equalName, `(*`, p.QualifiedGoIdent(msg.GoIdent), `) bool }); ok {`) p.P(` if !equal.`, equalName, `(`, rhs, `) {`) diff --git a/features/size/size.go b/features/size/size.go index 2fda5d5..9cfb5b2 100644 --- a/features/size/size.go +++ b/features/size/size.go @@ -57,12 +57,12 @@ func (p *size) GenerateHelpers() { func (p *size) messageSize(varName, sizeName string, message *protogen.Message) { switch { - case p.IsLocalMessage(message): - p.P(`l = `, varName, `.`, sizeName, `()`) - case p.IsWellKnownType(message): p.P(`l = (*`, p.WellKnownTypeMap(message), `)(`, varName, `).`, sizeName, `()`) + case p.IsLocalMessage(message): + p.P(`l = `, varName, `.`, sizeName, `()`) + default: p.P(`if size, ok := interface{}(`, varName, `).(interface{`) p.P(sizeName, `() int`) @@ -325,6 +325,9 @@ func (p *size) message(message *protogen.Message) { continue } ccTypeName := field.GoIdent + if p.IsWellKnownType(message) && p.IsLocalMessage(message) { + ccTypeName.GoImportPath = "" + } p.P(`func (m *`, ccTypeName, `) `, sizeName, `() (n int) {`) p.P(`if m == nil {`) p.P(`return 0`) diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go index 3fe3929..232808f 100644 --- a/types/known/structpb/struct_vtproto.pb.go +++ b/types/known/structpb/struct_vtproto.pb.go @@ -161,7 +161,7 @@ func (this *Struct) EqualVT(that *Struct) bool { if q == nil { q = &structpb.Value{} } - if !p.EqualVT(q) { + if !(*Value)(p).EqualVT((*Value)(q)) { return false } } @@ -274,7 +274,7 @@ func (this *Value_StructValue) EqualVT(thatIface isValue_Kind) bool { if q == nil { q = &structpb.Struct{} } - if !p.EqualVT(q) { + if !(*Struct)(p).EqualVT((*Struct)(q)) { return false } } @@ -299,7 +299,7 @@ func (this *Value_ListValue) EqualVT(thatIface isValue_Kind) bool { if q == nil { q = &structpb.ListValue{} } - if !p.EqualVT(q) { + if !(*ListValue)(p).EqualVT((*ListValue)(q)) { return false } } @@ -324,7 +324,7 @@ func (this *ListValue) EqualVT(that *ListValue) bool { if q == nil { q = &structpb.Value{} } - if !p.EqualVT(q) { + if !(*Value)(p).EqualVT((*Value)(q)) { return false } } @@ -836,7 +836,7 @@ func (m *Struct) SizeVT() (n int) { _ = v l = 0 if v != nil { - l = v.SizeVT() + l = (*Value)(v).SizeVT() } l += 1 + sov(uint64(l)) mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l @@ -858,7 +858,7 @@ func (m *Value) SizeVT() (n int) { return n } -func (m *structpb.Value_NullValue) SizeVT() (n int) { +func (m *Value_NullValue) SizeVT() (n int) { if m == nil { return 0 } @@ -867,7 +867,7 @@ func (m *structpb.Value_NullValue) SizeVT() (n int) { n += 1 + sov(uint64(m.NullValue)) return n } -func (m *structpb.Value_NumberValue) SizeVT() (n int) { +func (m *Value_NumberValue) SizeVT() (n int) { if m == nil { return 0 } @@ -876,7 +876,7 @@ func (m *structpb.Value_NumberValue) SizeVT() (n int) { n += 9 return n } -func (m *structpb.Value_StringValue) SizeVT() (n int) { +func (m *Value_StringValue) SizeVT() (n int) { if m == nil { return 0 } @@ -886,7 +886,7 @@ func (m *structpb.Value_StringValue) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) return n } -func (m *structpb.Value_BoolValue) SizeVT() (n int) { +func (m *Value_BoolValue) SizeVT() (n int) { if m == nil { return 0 } @@ -895,26 +895,26 @@ func (m *structpb.Value_BoolValue) SizeVT() (n int) { n += 2 return n } -func (m *structpb.Value_StructValue) SizeVT() (n int) { +func (m *Value_StructValue) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l if m.StructValue != nil { - l = m.StructValue.SizeVT() + l = (*Struct)(m.StructValue).SizeVT() n += 1 + l + sov(uint64(l)) } return n } -func (m *structpb.Value_ListValue) SizeVT() (n int) { +func (m *Value_ListValue) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l if m.ListValue != nil { - l = m.ListValue.SizeVT() + l = (*ListValue)(m.ListValue).SizeVT() n += 1 + l + sov(uint64(l)) } return n @@ -927,7 +927,7 @@ func (m *ListValue) SizeVT() (n int) { _ = l if len(m.Values) > 0 { for _, e := range m.Values { - l = e.SizeVT() + l = (*Value)(e).SizeVT() n += 1 + l + sov(uint64(l)) } } From 0c94c025edea2d4c00fbe608159f4116cdb28703 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 22 Nov 2023 11:38:49 -0800 Subject: [PATCH 04/18] Passing all but conformance --- features/equal/equal.go | 33 +++++- features/marshal/marshalto.go | 7 +- features/unmarshal/unmarshal.go | 8 +- types/known/structpb/struct_vtproto.pb.go | 117 ++++++++++++++++------ types/known/structpb/temp.go | 4 - 5 files changed, 123 insertions(+), 46 deletions(-) delete mode 100644 types/known/structpb/temp.go diff --git a/features/equal/equal.go b/features/equal/equal.go index facbc3c..8d5d6fe 100644 --- a/features/equal/equal.go +++ b/features/equal/equal.go @@ -87,9 +87,20 @@ func (p *equal) message(proto3 bool, message *protogen.Message) { p.P(` return false`) p.P(` }`) ccInterfaceName := fmt.Sprintf("is%s", field.Oneof.GoIdent.GoName) - p.P(`if !this.`, fieldname, `.(interface{ `, equalName, `(`, ccInterfaceName, `) bool }).`, equalName, `(that.`, fieldname, `) {`) - p.P(`return false`) - p.P(`}`) + if p.IsWellKnownType(message) { + p.P(`switch c := this.`, fieldname, `.(type) {`) + for _, f := range field.Oneof.Fields { + p.P(`case *`, f.GoIdent, `:`) + p.P(`if !(*`, p.WellKnownFieldMap(f), `)(c).`, equalName, `(that.`, fieldname, `) {`) + p.P(`return false`) + p.P(`}`) + } + p.P(`}`) + } else { + p.P(`if !this.`, fieldname, `.(interface{ `, equalName, `(`, ccInterfaceName, `) bool }).`, equalName, `(that.`, fieldname, `) {`) + p.P(`return false`) + p.P(`}`) + } p.P(`}`) } } @@ -134,10 +145,22 @@ func (p *equal) oneof(field *protogen.Field) { ccInterfaceName := fmt.Sprintf("is%s", field.Oneof.GoIdent.GoName) fieldname := field.GoName - p.P(`func (this *`, ccTypeName, `) `, equalName, `(thatIface `, ccInterfaceName, `) bool {`) + if p.IsWellKnownType(field.Parent) { + p.P(`func (this *`, ccTypeName, `) `, equalName, `(thatIface any) bool {`) + } else { + p.P(`func (this *`, ccTypeName, `) `, equalName, `(thatIface `, ccInterfaceName, `) bool {`) + } p.P(`that, ok := thatIface.(*`, ccTypeName, `)`) p.P(`if !ok {`) - p.P(`return false`) + if p.IsWellKnownType(field.Parent) { + p.P(`if ot, ok := thatIface.(*`, field.GoIdent, `); ok {`) + p.P(`that = (*`, ccTypeName, `)(ot)`) + p.P("} else {") + p.P("return false") + p.P("}") + } else { + p.P(`return false`) + } p.P(`}`) p.P(`if this == that {`) p.P(`return true`) diff --git a/features/marshal/marshalto.go b/features/marshal/marshalto.go index c24e927..0282e83 100644 --- a/features/marshal/marshalto.go +++ b/features/marshal/marshalto.go @@ -635,7 +635,12 @@ func (p *marshal) message(message *protogen.Message) { if !oneof { p.field(false, &numGen, field) } else { - p.P(`if msg, ok := m.`, field.Oneof.GoName, `.(*`, field.GoIdent.GoName, `); ok {`) + if p.IsWellKnownType(message) { + p.P(`if m, ok := m.`, field.Oneof.GoName, `.(*`, field.GoIdent, `); ok {`) + p.P(`msg := ((*`, p.WellKnownFieldMap(field), `)(m))`) + } else { + p.P(`if msg, ok := m.`, field.Oneof.GoName, `.(*`, field.GoIdent.GoName, `); ok {`) + } marshalForwardOneOf("msg") p.P(`}`) } diff --git a/features/unmarshal/unmarshal.go b/features/unmarshal/unmarshal.go index 77d65dc..ae3edd8 100644 --- a/features/unmarshal/unmarshal.go +++ b/features/unmarshal/unmarshal.go @@ -146,13 +146,13 @@ func (p *unmarshal) methodUnmarshal() string { func (p *unmarshal) decodeMessage(varName, buf string, message *protogen.Message) { switch { - case p.IsLocalMessage(message): - p.P(`if err := `, varName, `.`, p.methodUnmarshal(), `(`, buf, `); err != nil {`) + case p.IsWellKnownType(message): + p.P(`if err := (*`, p.WellKnownTypeMap(message), `)(`, varName, `).`, p.methodUnmarshal(), `(`, buf, `); err != nil {`) p.P(`return err`) p.P(`}`) - case p.IsWellKnownType(message): - p.P(`if err := (*`, p.WellKnownTypeMap(message), `)(`, varName, `).`, p.methodUnmarshal(), `(`, buf, `); err != nil {`) + case p.IsLocalMessage(message): + p.P(`if err := `, varName, `.`, p.methodUnmarshal(), `(`, buf, `); err != nil {`) p.P(`return err`) p.P(`}`) diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go index 232808f..587339d 100644 --- a/types/known/structpb/struct_vtproto.pb.go +++ b/types/known/structpb/struct_vtproto.pb.go @@ -181,17 +181,44 @@ func (this *Value) EqualVT(that *Value) bool { if that.Kind == nil { return false } - if !this.Kind.(interface{ EqualVT(isValue_Kind) bool }).EqualVT(that.Kind) { - return false + switch c := this.Kind.(type) { + case *structpb.Value_NullValue: + if !(*Value_NullValue)(c).EqualVT(that.Kind) { + return false + } + case *structpb.Value_NumberValue: + if !(*Value_NumberValue)(c).EqualVT(that.Kind) { + return false + } + case *structpb.Value_StringValue: + if !(*Value_StringValue)(c).EqualVT(that.Kind) { + return false + } + case *structpb.Value_BoolValue: + if !(*Value_BoolValue)(c).EqualVT(that.Kind) { + return false + } + case *structpb.Value_StructValue: + if !(*Value_StructValue)(c).EqualVT(that.Kind) { + return false + } + case *structpb.Value_ListValue: + if !(*Value_ListValue)(c).EqualVT(that.Kind) { + return false + } } } return true } -func (this *Value_NullValue) EqualVT(thatIface isValue_Kind) bool { +func (this *Value_NullValue) EqualVT(thatIface any) bool { that, ok := thatIface.(*Value_NullValue) if !ok { - return false + if ot, ok := thatIface.(*structpb.Value_NullValue); ok { + that = (*Value_NullValue)(ot) + } else { + return false + } } if this == that { return true @@ -205,10 +232,14 @@ func (this *Value_NullValue) EqualVT(thatIface isValue_Kind) bool { return true } -func (this *Value_NumberValue) EqualVT(thatIface isValue_Kind) bool { +func (this *Value_NumberValue) EqualVT(thatIface any) bool { that, ok := thatIface.(*Value_NumberValue) if !ok { - return false + if ot, ok := thatIface.(*structpb.Value_NumberValue); ok { + that = (*Value_NumberValue)(ot) + } else { + return false + } } if this == that { return true @@ -222,10 +253,14 @@ func (this *Value_NumberValue) EqualVT(thatIface isValue_Kind) bool { return true } -func (this *Value_StringValue) EqualVT(thatIface isValue_Kind) bool { +func (this *Value_StringValue) EqualVT(thatIface any) bool { that, ok := thatIface.(*Value_StringValue) if !ok { - return false + if ot, ok := thatIface.(*structpb.Value_StringValue); ok { + that = (*Value_StringValue)(ot) + } else { + return false + } } if this == that { return true @@ -239,10 +274,14 @@ func (this *Value_StringValue) EqualVT(thatIface isValue_Kind) bool { return true } -func (this *Value_BoolValue) EqualVT(thatIface isValue_Kind) bool { +func (this *Value_BoolValue) EqualVT(thatIface any) bool { that, ok := thatIface.(*Value_BoolValue) if !ok { - return false + if ot, ok := thatIface.(*structpb.Value_BoolValue); ok { + that = (*Value_BoolValue)(ot) + } else { + return false + } } if this == that { return true @@ -256,10 +295,14 @@ func (this *Value_BoolValue) EqualVT(thatIface isValue_Kind) bool { return true } -func (this *Value_StructValue) EqualVT(thatIface isValue_Kind) bool { +func (this *Value_StructValue) EqualVT(thatIface any) bool { that, ok := thatIface.(*Value_StructValue) if !ok { - return false + if ot, ok := thatIface.(*structpb.Value_StructValue); ok { + that = (*Value_StructValue)(ot) + } else { + return false + } } if this == that { return true @@ -281,10 +324,14 @@ func (this *Value_StructValue) EqualVT(thatIface isValue_Kind) bool { return true } -func (this *Value_ListValue) EqualVT(thatIface isValue_Kind) bool { +func (this *Value_ListValue) EqualVT(thatIface any) bool { that, ok := thatIface.(*Value_ListValue) if !ok { - return false + if ot, ok := thatIface.(*structpb.Value_ListValue); ok { + that = (*Value_ListValue)(ot) + } else { + return false + } } if this == that { return true @@ -644,42 +691,48 @@ func (m *Value) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { _ = i var l int _ = l - if msg, ok := m.Kind.(*Value_ListValue); ok { + if m, ok := m.Kind.(*structpb.Value_ListValue); ok { + msg := ((*Value_ListValue)(m)) size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } i -= size } - if msg, ok := m.Kind.(*Value_StructValue); ok { + if m, ok := m.Kind.(*structpb.Value_StructValue); ok { + msg := ((*Value_StructValue)(m)) size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } i -= size } - if msg, ok := m.Kind.(*Value_BoolValue); ok { + if m, ok := m.Kind.(*structpb.Value_BoolValue); ok { + msg := ((*Value_BoolValue)(m)) size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } i -= size } - if msg, ok := m.Kind.(*Value_StringValue); ok { + if m, ok := m.Kind.(*structpb.Value_StringValue); ok { + msg := ((*Value_StringValue)(m)) size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } i -= size } - if msg, ok := m.Kind.(*Value_NumberValue); ok { + if m, ok := m.Kind.(*structpb.Value_NumberValue); ok { + msg := ((*Value_NumberValue)(m)) size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } i -= size } - if msg, ok := m.Kind.(*Value_NullValue); ok { + if m, ok := m.Kind.(*structpb.Value_NullValue); ok { + msg := ((*Value_NullValue)(m)) size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err @@ -1077,7 +1130,7 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } mapvalue = &structpb.Value{} - if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + if err := (*Value)(mapvalue).UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex @@ -1262,12 +1315,12 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Kind.(*structpb.Value_StructValue); ok { - if err := oneof.StructValue.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*Struct)(oneof.StructValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } } else { v := &structpb.Struct{} - if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*Struct)(v).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &structpb.Value_StructValue{StructValue: v} @@ -1303,12 +1356,12 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Kind.(*structpb.Value_ListValue); ok { - if err := oneof.ListValue.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*ListValue)(oneof.ListValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } } else { v := &structpb.ListValue{} - if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*ListValue)(v).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &structpb.Value_ListValue{ListValue: v} @@ -1394,7 +1447,7 @@ func (m *ListValue) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } m.Values = append(m.Values, &structpb.Value{}) - if err := m.Values[len(m.Values)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*Value)(m.Values[len(m.Values)-1]).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1642,7 +1695,7 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } mapvalue = &structpb.Value{} - if err := mapvalue.UnmarshalVTUnsafe(dAtA[iNdEx:postmsgIndex]); err != nil { + if err := (*Value)(mapvalue).UnmarshalVTUnsafe(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex @@ -1827,12 +1880,12 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Kind.(*structpb.Value_StructValue); ok { - if err := oneof.StructValue.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*Struct)(oneof.StructValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } } else { v := &structpb.Struct{} - if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*Struct)(v).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &structpb.Value_StructValue{StructValue: v} @@ -1868,12 +1921,12 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Kind.(*structpb.Value_ListValue); ok { - if err := oneof.ListValue.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*ListValue)(oneof.ListValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } } else { v := &structpb.ListValue{} - if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*ListValue)(v).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &structpb.Value_ListValue{ListValue: v} @@ -1959,7 +2012,7 @@ func (m *ListValue) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } m.Values = append(m.Values, &structpb.Value{}) - if err := m.Values[len(m.Values)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*Value)(m.Values[len(m.Values)-1]).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/types/known/structpb/temp.go b/types/known/structpb/temp.go deleted file mode 100644 index 3415a85..0000000 --- a/types/known/structpb/temp.go +++ /dev/null @@ -1,4 +0,0 @@ -package structpb - -type isValue_Kind interface { -} From 2c43b2ab0109f38b5de82265391a04c135cab68b Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 22 Nov 2023 12:46:20 -0800 Subject: [PATCH 05/18] fix size and marshal --- features/marshal/marshalto.go | 21 +++++++-- features/size/size.go | 16 ++++++- types/known/structpb/struct_vtproto.pb.go | 52 ++++++++++++++++++++--- 3 files changed, 77 insertions(+), 12 deletions(-) diff --git a/features/marshal/marshalto.go b/features/marshal/marshalto.go index 0282e83..b54b084 100644 --- a/features/marshal/marshalto.go +++ b/features/marshal/marshalto.go @@ -620,8 +620,11 @@ func (p *marshal) message(message *protogen.Message) { return message.Fields[i].Desc.Number() < message.Fields[j].Desc.Number() }) - marshalForwardOneOf := func(varname string) { - p.P(`size, err := `, varname, `.`, p.methodMarshalToSizedBuffer(), `(dAtA[:i])`) + marshalForwardOneOf := func(varname ...any) { + l := []any{`size, err := `} + l = append(l, varname...) + l = append(l, `.`, p.methodMarshalToSizedBuffer(), `(dAtA[:i])`) + p.P(l...) p.P(`if err != nil {`) p.P(`return 0, err`) p.P(`}`) @@ -655,8 +658,18 @@ func (p *marshal) message(message *protogen.Message) { oneof := field.Oneof != nil && !field.Oneof.Desc.IsSynthetic() if oneof { fieldname := field.Oneof.GoName - if _, ok := oneofs[fieldname]; !ok { - oneofs[fieldname] = struct{}{} + if _, ok := oneofs[fieldname]; ok { + continue + } + oneofs[fieldname] = struct{}{} + if p.IsWellKnownType(message) { + p.P(`switch c := m.`, fieldname, `.(type) {`) + for _, f := range field.Oneof.Fields { + p.P(`case *`, f.GoIdent, `:`) + marshalForwardOneOf(`(*`, p.WellKnownFieldMap(f), `)(c)`) + } + p.P(`}`) + } else { p.P(`if vtmsg, ok := m.`, fieldname, `.(interface{`) p.P(p.methodMarshalToSizedBuffer(), ` ([]byte) (int, error)`) p.P(`}); ok {`) diff --git a/features/size/size.go b/features/size/size.go index 9cfb5b2..b4db606 100644 --- a/features/size/size.go +++ b/features/size/size.go @@ -305,8 +305,20 @@ func (p *size) message(message *protogen.Message) { p.field(false, field, sizeName) } else { fieldname := field.Oneof.GoName - if _, ok := oneofs[fieldname]; !ok { - oneofs[fieldname] = struct{}{} + if _, ok := oneofs[fieldname]; ok { + continue + } + oneofs[fieldname] = struct{}{} + if p.IsWellKnownType(message) { + p.P(`switch c := m.`, fieldname, `.(type) {`) + for _, f := range field.Oneof.Fields { + p.P(`case *`, f.GoIdent, `:`) + p.P(`n += (*`, p.WellKnownFieldMap(f), `)(c).`, sizeName, `()`) + } + p.P(`}`) + } else { + //if _, ok := oneofs[fieldname]; !ok { + //oneofs[fieldname] = struct{}{} p.P(`if vtmsg, ok := m.`, fieldname, `.(interface{ SizeVT() int }); ok {`) p.P(`n+=vtmsg.`, sizeName, `()`) p.P(`}`) diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go index 587339d..8b3e93c 100644 --- a/types/known/structpb/struct_vtproto.pb.go +++ b/types/known/structpb/struct_vtproto.pb.go @@ -456,10 +456,39 @@ func (m *Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { _ = i var l int _ = l - if vtmsg, ok := m.Kind.(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + switch c := m.Kind.(type) { + case *structpb.Value_NullValue: + size, err := (*Value_NullValue)(c).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + case *structpb.Value_NumberValue: + size, err := (*Value_NumberValue)(c).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + case *structpb.Value_StringValue: + size, err := (*Value_StringValue)(c).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + case *structpb.Value_BoolValue: + size, err := (*Value_BoolValue)(c).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + case *structpb.Value_StructValue: + size, err := (*Value_StructValue)(c).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + case *structpb.Value_ListValue: + size, err := (*Value_ListValue)(c).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -905,8 +934,19 @@ func (m *Value) SizeVT() (n int) { } var l int _ = l - if vtmsg, ok := m.Kind.(interface{ SizeVT() int }); ok { - n += vtmsg.SizeVT() + switch c := m.Kind.(type) { + case *structpb.Value_NullValue: + n += (*Value_NullValue)(c).SizeVT() + case *structpb.Value_NumberValue: + n += (*Value_NumberValue)(c).SizeVT() + case *structpb.Value_StringValue: + n += (*Value_StringValue)(c).SizeVT() + case *structpb.Value_BoolValue: + n += (*Value_BoolValue)(c).SizeVT() + case *structpb.Value_StructValue: + n += (*Value_StructValue)(c).SizeVT() + case *structpb.Value_ListValue: + n += (*Value_ListValue)(c).SizeVT() } return n } From 1b8fa7a39e0bedb3c406edf52e81ff715f3ab214 Mon Sep 17 00:00:00 2001 From: John Howard Date: Mon, 4 Dec 2023 14:10:51 -0800 Subject: [PATCH 06/18] Bump go.mod dependencies --- go.mod | 20 ++++---- go.sum | 143 +++++++++------------------------------------------------ 2 files changed, 31 insertions(+), 132 deletions(-) diff --git a/go.mod b/go.mod index ee3252c..7932ad4 100644 --- a/go.mod +++ b/go.mod @@ -3,18 +3,18 @@ module github.com/planetscale/vtprotobuf go 1.20 require ( - github.com/stretchr/testify v1.7.1 - google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.26.0 + github.com/stretchr/testify v1.8.4 + google.golang.org/grpc v1.59.0 + google.golang.org/protobuf v1.31.0 ) require ( - github.com/davecgh/go-spew v1.1.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect - golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect - golang.org/x/text v0.3.3 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7315018..87d8531 100644 --- a/go.sum +++ b/go.sum @@ -1,131 +1,30 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From d660eab9a7beb46d2e0f9e861a63f976a9fadbc1 Mon Sep 17 00:00:00 2001 From: John Howard Date: Mon, 4 Dec 2023 14:23:42 -0800 Subject: [PATCH 07/18] Regen --- .../internal/conformance/conformance.pb.go | 2 +- .../conformance/test_messages_proto2.pb.go | 21 +------------------ .../conformance/test_messages_proto3.pb.go | 6 +++--- testproto/empty/empty.pb.go | 2 +- testproto/grpc/grpc.pb.go | 2 +- testproto/grpc/inner/inner.pb.go | 2 +- testproto/pool/pool.pb.go | 2 +- testproto/pool/pool_with_oneof.pb.go | 2 +- testproto/pool/pool_with_slice_reuse.pb.go | 2 +- testproto/proto2/scalars.pb.go | 2 +- testproto/proto3opt/opt.pb.go | 2 +- testproto/unsafe/unsafe.pb.go | 2 +- testproto/wkt/wkt.pb.go | 4 ++-- vtproto/ext.pb.go | 2 +- 14 files changed, 17 insertions(+), 36 deletions(-) diff --git a/conformance/internal/conformance/conformance.pb.go b/conformance/internal/conformance/conformance.pb.go index f8f463a..10a4962 100644 --- a/conformance/internal/conformance/conformance.pb.go +++ b/conformance/internal/conformance/conformance.pb.go @@ -30,7 +30,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: conformance/conformance.proto diff --git a/conformance/internal/conformance/test_messages_proto2.pb.go b/conformance/internal/conformance/test_messages_proto2.pb.go index 740affc..8178fc3 100644 --- a/conformance/internal/conformance/test_messages_proto2.pb.go +++ b/conformance/internal/conformance/test_messages_proto2.pb.go @@ -37,7 +37,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: src/google/protobuf/test_messages_proto2.proto @@ -45,7 +45,6 @@ package conformance import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" @@ -449,15 +448,6 @@ func (*TestAllTypesProto2) Descriptor() ([]byte, []int) { return file_src_google_protobuf_test_messages_proto2_proto_rawDescGZIP(), []int{0} } -var extRange_TestAllTypesProto2 = []protoiface.ExtensionRangeV1{ - {Start: 120, End: 200}, -} - -// Deprecated: Use TestAllTypesProto2.ProtoReflect.Descriptor.ExtensionRanges instead. -func (*TestAllTypesProto2) ExtensionRangeArray() []protoiface.ExtensionRangeV1 { - return extRange_TestAllTypesProto2 -} - func (x *TestAllTypesProto2) GetOptionalInt32() int32 { if x != nil && x.OptionalInt32 != nil { return *x.OptionalInt32 @@ -1862,15 +1852,6 @@ func (*TestAllTypesProto2_MessageSetCorrect) Descriptor() ([]byte, []int) { return file_src_google_protobuf_test_messages_proto2_proto_rawDescGZIP(), []int{0, 21} } -var extRange_TestAllTypesProto2_MessageSetCorrect = []protoiface.ExtensionRangeV1{ - {Start: 4, End: 2147483646}, -} - -// Deprecated: Use TestAllTypesProto2_MessageSetCorrect.ProtoReflect.Descriptor.ExtensionRanges instead. -func (*TestAllTypesProto2_MessageSetCorrect) ExtensionRangeArray() []protoiface.ExtensionRangeV1 { - return extRange_TestAllTypesProto2_MessageSetCorrect -} - type TestAllTypesProto2_MessageSetCorrectExtension1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/conformance/internal/conformance/test_messages_proto3.pb.go b/conformance/internal/conformance/test_messages_proto3.pb.go index 3aa0cf3..198a99a 100644 --- a/conformance/internal/conformance/test_messages_proto3.pb.go +++ b/conformance/internal/conformance/test_messages_proto3.pb.go @@ -37,7 +37,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: src/google/protobuf/test_messages_proto3.proto @@ -1187,7 +1187,7 @@ func (x *TestAllTypesProto3) GetOneofNullValue() structpb.NullValue { if x, ok := x.GetOneofField().(*TestAllTypesProto3_OneofNullValue); ok { return x.OneofNullValue } - return structpb.NullValue_NULL_VALUE + return structpb.NullValue(0) } func (x *TestAllTypesProto3) GetOptionalBoolWrapper() *wrapperspb.BoolValue { @@ -1362,7 +1362,7 @@ func (x *TestAllTypesProto3) GetOptionalNullValue() structpb.NullValue { if x != nil { return x.OptionalNullValue } - return structpb.NullValue_NULL_VALUE + return structpb.NullValue(0) } func (x *TestAllTypesProto3) GetRepeatedDuration() []*durationpb.Duration { diff --git a/testproto/empty/empty.pb.go b/testproto/empty/empty.pb.go index 972b350..e8d0ab2 100644 --- a/testproto/empty/empty.pb.go +++ b/testproto/empty/empty.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: empty/empty.proto diff --git a/testproto/grpc/grpc.pb.go b/testproto/grpc/grpc.pb.go index 64cb68e..7f24b87 100644 --- a/testproto/grpc/grpc.pb.go +++ b/testproto/grpc/grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: testproto/grpc/grpc.proto diff --git a/testproto/grpc/inner/inner.pb.go b/testproto/grpc/inner/inner.pb.go index c173435..44f019e 100644 --- a/testproto/grpc/inner/inner.pb.go +++ b/testproto/grpc/inner/inner.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: testproto/grpc/inner/inner.proto diff --git a/testproto/pool/pool.pb.go b/testproto/pool/pool.pb.go index 4f16bad..2952ef4 100644 --- a/testproto/pool/pool.pb.go +++ b/testproto/pool/pool.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: pool/pool.proto diff --git a/testproto/pool/pool_with_oneof.pb.go b/testproto/pool/pool_with_oneof.pb.go index 615be67..338067a 100644 --- a/testproto/pool/pool_with_oneof.pb.go +++ b/testproto/pool/pool_with_oneof.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: pool/pool_with_oneof.proto diff --git a/testproto/pool/pool_with_slice_reuse.pb.go b/testproto/pool/pool_with_slice_reuse.pb.go index 6de4cf3..aca7438 100644 --- a/testproto/pool/pool_with_slice_reuse.pb.go +++ b/testproto/pool/pool_with_slice_reuse.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: pool/pool_with_slice_reuse.proto diff --git a/testproto/proto2/scalars.pb.go b/testproto/proto2/scalars.pb.go index 5157de6..ef66ef6 100644 --- a/testproto/proto2/scalars.pb.go +++ b/testproto/proto2/scalars.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: proto2/scalars.proto diff --git a/testproto/proto3opt/opt.pb.go b/testproto/proto3opt/opt.pb.go index 93a46d3..bfd7750 100644 --- a/testproto/proto3opt/opt.pb.go +++ b/testproto/proto3opt/opt.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: proto3opt/opt.proto diff --git a/testproto/unsafe/unsafe.pb.go b/testproto/unsafe/unsafe.pb.go index e17dc00..4b5a345 100644 --- a/testproto/unsafe/unsafe.pb.go +++ b/testproto/unsafe/unsafe.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: unsafe/unsafe.proto diff --git a/testproto/wkt/wkt.pb.go b/testproto/wkt/wkt.pb.go index 02ba6d5..31d29a1 100644 --- a/testproto/wkt/wkt.pb.go +++ b/testproto/wkt/wkt.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: wkt/wkt.proto @@ -207,7 +207,7 @@ func (x *MessageWithWKT) GetNullValue() structpb.NullValue { if x != nil { return x.NullValue } - return structpb.NullValue_NULL_VALUE + return structpb.NullValue(0) } var File_wkt_wkt_proto protoreflect.FileDescriptor diff --git a/vtproto/ext.pb.go b/vtproto/ext.pb.go index b0f63a2..98c14a6 100644 --- a/vtproto/ext.pb.go +++ b/vtproto/ext.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: github.com/planetscale/vtprotobuf/vtproto/ext.proto From 1a593c029b05d43f6ba53ac85633394469979019 Mon Sep 17 00:00:00 2001 From: Corentin Dupret Date: Tue, 5 Dec 2023 17:34:43 +0100 Subject: [PATCH 08/18] Add a protohelpers package with public helpers --- protohelpers/protohelpers.go | 122 +++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 protohelpers/protohelpers.go diff --git a/protohelpers/protohelpers.go b/protohelpers/protohelpers.go new file mode 100644 index 0000000..64bde83 --- /dev/null +++ b/protohelpers/protohelpers.go @@ -0,0 +1,122 @@ +// Package protohelpers provides helper functions for encoding and decoding protobuf messages. +// The spec can be found at https://protobuf.dev/programming-guides/encoding/. +package protohelpers + +import ( + "fmt" + "io" + "math/bits" +) + +var ( + // ErrInvalidLength is returned when decoding a negative length. + ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") + // ErrIntOverflow is returned when decoding a varint representation of an integer that overflows 64 bits. + ErrIntOverflow = fmt.Errorf("proto: integer overflow") + // ErrUnexpectedEndOfGroup is returned when decoding a group end without a corresponding group start. + ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") +) + +// EncodeVarint encodes a uint64 into a varint-encoded byte slice and returns the offset of the encoded value. +// The provided offset is the offset after the last byte of the encoded value. +func EncodeVarint(dAtA []byte, offset int, v uint64) int { + offset -= SizeOfVarint(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} + +// SizeOfVarint returns the size of the varint-encoded value. +func SizeOfVarint(x uint64) (n int) { + return (bits.Len64(x|1) + 6) / 7 +} + +// SizeOfZigzag returns the size of the zigzag-encoded value. +func SizeOfZigzag(x uint64) (n int) { + return SizeOfVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} + +// Skip the first record of the byte slice and return the offset of the next record. +func Skip(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLength + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroup + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLength + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} From 859ae731f55bc16d31b43ebed608949cc07cebdb Mon Sep 17 00:00:00 2001 From: Corentin Dupret Date: Tue, 5 Dec 2023 19:08:03 +0100 Subject: [PATCH 09/18] Use public helpers instead of generating them Make the generated code use public helpers instead of generating them in each package. --- .../conformance/conformance_vtproto.pb.go | 347 +- .../test_messages_proto2_vtproto.pb.go | 2981 ++++++++------- .../test_messages_proto3_vtproto.pb.go | 3195 +++++++++-------- features/clone/clone.go | 3 - features/equal/equal.go | 4 +- features/grpc/grpc_plugin.go | 2 - features/marshal/marshalto.go | 24 +- features/pool/pool.go | 2 - features/size/size.go | 93 +- features/unmarshal/unmarshal.go | 135 +- generator/features.go | 1 - generator/generatedfile.go | 26 +- generator/generator.go | 19 +- testproto/grpc/grpc_vtproto.pb.go | 129 +- testproto/grpc/inner/inner_vtproto.pb.go | 129 +- testproto/pool/pool_vtproto.pb.go | 175 +- testproto/pool/pool_with_oneof_vtproto.pb.go | 189 +- .../pool/pool_with_slice_reuse_vtproto.pb.go | 217 +- testproto/proto2/scalars_vtproto.pb.go | 1185 +++--- testproto/proto3opt/opt_vtproto.pb.go | 227 +- testproto/unsafe/unsafe_vtproto.pb.go | 412 +-- testproto/wkt/wkt_vtproto.pb.go | 433 +-- types/known/anypb/any_vtproto.pb.go | 153 +- types/known/durationpb/duration_vtproto.pb.go | 137 +- types/known/emptypb/empty_vtproto.pb.go | 117 +- .../fieldmaskpb/field_mask_vtproto.pb.go | 135 +- types/known/structpb/struct_vtproto.pb.go | 293 +- .../known/timestamppb/timestamp_vtproto.pb.go | 137 +- types/known/wrapperspb/wrappers_vtproto.pb.go | 293 +- 29 files changed, 4758 insertions(+), 6435 deletions(-) diff --git a/conformance/internal/conformance/conformance_vtproto.pb.go b/conformance/internal/conformance/conformance_vtproto.pb.go index 837109b..1d7e0c7 100644 --- a/conformance/internal/conformance/conformance_vtproto.pb.go +++ b/conformance/internal/conformance/conformance_vtproto.pb.go @@ -6,6 +6,7 @@ package conformance import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" @@ -573,7 +574,7 @@ func (m *FailureSet) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Failure) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Failure[iNdEx]) copy(dAtA[i:], m.Failure[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Failure[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Failure[iNdEx]))) i-- dAtA[i] = 0xa } @@ -636,24 +637,24 @@ func (m *ConformanceRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } if m.TestCategory != 0 { - i = encodeVarint(dAtA, i, uint64(m.TestCategory)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TestCategory)) i-- dAtA[i] = 0x28 } if len(m.MessageType) > 0 { i -= len(m.MessageType) copy(dAtA[i:], m.MessageType) - i = encodeVarint(dAtA, i, uint64(len(m.MessageType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MessageType))) i-- dAtA[i] = 0x22 } if m.RequestedOutputFormat != 0 { - i = encodeVarint(dAtA, i, uint64(m.RequestedOutputFormat)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestedOutputFormat)) i-- dAtA[i] = 0x18 } @@ -669,7 +670,7 @@ func (m *ConformanceRequest_ProtobufPayload) MarshalToSizedBufferVT(dAtA []byte) i := len(dAtA) i -= len(m.ProtobufPayload) copy(dAtA[i:], m.ProtobufPayload) - i = encodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -683,7 +684,7 @@ func (m *ConformanceRequest_JsonPayload) MarshalToSizedBufferVT(dAtA []byte) (in i := len(dAtA) i -= len(m.JsonPayload) copy(dAtA[i:], m.JsonPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JsonPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JsonPayload))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -697,7 +698,7 @@ func (m *ConformanceRequest_JspbPayload) MarshalToSizedBufferVT(dAtA []byte) (in i := len(dAtA) i -= len(m.JspbPayload) copy(dAtA[i:], m.JspbPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JspbPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JspbPayload))) i-- dAtA[i] = 0x3a return len(dAtA) - i, nil @@ -711,7 +712,7 @@ func (m *ConformanceRequest_TextPayload) MarshalToSizedBufferVT(dAtA []byte) (in i := len(dAtA) i -= len(m.TextPayload) copy(dAtA[i:], m.TextPayload) - i = encodeVarint(dAtA, i, uint64(len(m.TextPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TextPayload))) i-- dAtA[i] = 0x42 return len(dAtA) - i, nil @@ -767,7 +768,7 @@ func (m *ConformanceResponse_ParseError) MarshalToSizedBufferVT(dAtA []byte) (in i := len(dAtA) i -= len(m.ParseError) copy(dAtA[i:], m.ParseError) - i = encodeVarint(dAtA, i, uint64(len(m.ParseError))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ParseError))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -781,7 +782,7 @@ func (m *ConformanceResponse_RuntimeError) MarshalToSizedBufferVT(dAtA []byte) ( i := len(dAtA) i -= len(m.RuntimeError) copy(dAtA[i:], m.RuntimeError) - i = encodeVarint(dAtA, i, uint64(len(m.RuntimeError))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RuntimeError))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -795,7 +796,7 @@ func (m *ConformanceResponse_ProtobufPayload) MarshalToSizedBufferVT(dAtA []byte i := len(dAtA) i -= len(m.ProtobufPayload) copy(dAtA[i:], m.ProtobufPayload) - i = encodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil @@ -809,7 +810,7 @@ func (m *ConformanceResponse_JsonPayload) MarshalToSizedBufferVT(dAtA []byte) (i i := len(dAtA) i -= len(m.JsonPayload) copy(dAtA[i:], m.JsonPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JsonPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JsonPayload))) i-- dAtA[i] = 0x22 return len(dAtA) - i, nil @@ -823,7 +824,7 @@ func (m *ConformanceResponse_Skipped) MarshalToSizedBufferVT(dAtA []byte) (int, i := len(dAtA) i -= len(m.Skipped) copy(dAtA[i:], m.Skipped) - i = encodeVarint(dAtA, i, uint64(len(m.Skipped))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Skipped))) i-- dAtA[i] = 0x2a return len(dAtA) - i, nil @@ -837,7 +838,7 @@ func (m *ConformanceResponse_SerializeError) MarshalToSizedBufferVT(dAtA []byte) i := len(dAtA) i -= len(m.SerializeError) copy(dAtA[i:], m.SerializeError) - i = encodeVarint(dAtA, i, uint64(len(m.SerializeError))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SerializeError))) i-- dAtA[i] = 0x32 return len(dAtA) - i, nil @@ -851,7 +852,7 @@ func (m *ConformanceResponse_JspbPayload) MarshalToSizedBufferVT(dAtA []byte) (i i := len(dAtA) i -= len(m.JspbPayload) copy(dAtA[i:], m.JspbPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JspbPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JspbPayload))) i-- dAtA[i] = 0x3a return len(dAtA) - i, nil @@ -865,7 +866,7 @@ func (m *ConformanceResponse_TextPayload) MarshalToSizedBufferVT(dAtA []byte) (i i := len(dAtA) i -= len(m.TextPayload) copy(dAtA[i:], m.TextPayload) - i = encodeVarint(dAtA, i, uint64(len(m.TextPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TextPayload))) i-- dAtA[i] = 0x42 return len(dAtA) - i, nil @@ -947,7 +948,7 @@ func (m *FailureSet) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.Failure) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Failure[iNdEx]) copy(dAtA[i:], m.Failure[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Failure[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Failure[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1015,24 +1016,24 @@ func (m *ConformanceRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } if m.TestCategory != 0 { - i = encodeVarint(dAtA, i, uint64(m.TestCategory)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TestCategory)) i-- dAtA[i] = 0x28 } if len(m.MessageType) > 0 { i -= len(m.MessageType) copy(dAtA[i:], m.MessageType) - i = encodeVarint(dAtA, i, uint64(len(m.MessageType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MessageType))) i-- dAtA[i] = 0x22 } if m.RequestedOutputFormat != 0 { - i = encodeVarint(dAtA, i, uint64(m.RequestedOutputFormat)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestedOutputFormat)) i-- dAtA[i] = 0x18 } @@ -1062,7 +1063,7 @@ func (m *ConformanceRequest_ProtobufPayload) MarshalToSizedBufferVTStrict(dAtA [ i := len(dAtA) i -= len(m.ProtobufPayload) copy(dAtA[i:], m.ProtobufPayload) - i = encodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1076,7 +1077,7 @@ func (m *ConformanceRequest_JsonPayload) MarshalToSizedBufferVTStrict(dAtA []byt i := len(dAtA) i -= len(m.JsonPayload) copy(dAtA[i:], m.JsonPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JsonPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JsonPayload))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -1090,7 +1091,7 @@ func (m *ConformanceRequest_JspbPayload) MarshalToSizedBufferVTStrict(dAtA []byt i := len(dAtA) i -= len(m.JspbPayload) copy(dAtA[i:], m.JspbPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JspbPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JspbPayload))) i-- dAtA[i] = 0x3a return len(dAtA) - i, nil @@ -1104,7 +1105,7 @@ func (m *ConformanceRequest_TextPayload) MarshalToSizedBufferVTStrict(dAtA []byt i := len(dAtA) i -= len(m.TextPayload) copy(dAtA[i:], m.TextPayload) - i = encodeVarint(dAtA, i, uint64(len(m.TextPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TextPayload))) i-- dAtA[i] = 0x42 return len(dAtA) - i, nil @@ -1207,7 +1208,7 @@ func (m *ConformanceResponse_ParseError) MarshalToSizedBufferVTStrict(dAtA []byt i := len(dAtA) i -= len(m.ParseError) copy(dAtA[i:], m.ParseError) - i = encodeVarint(dAtA, i, uint64(len(m.ParseError))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ParseError))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1221,7 +1222,7 @@ func (m *ConformanceResponse_RuntimeError) MarshalToSizedBufferVTStrict(dAtA []b i := len(dAtA) i -= len(m.RuntimeError) copy(dAtA[i:], m.RuntimeError) - i = encodeVarint(dAtA, i, uint64(len(m.RuntimeError))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RuntimeError))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -1235,7 +1236,7 @@ func (m *ConformanceResponse_ProtobufPayload) MarshalToSizedBufferVTStrict(dAtA i := len(dAtA) i -= len(m.ProtobufPayload) copy(dAtA[i:], m.ProtobufPayload) - i = encodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProtobufPayload))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil @@ -1249,7 +1250,7 @@ func (m *ConformanceResponse_JsonPayload) MarshalToSizedBufferVTStrict(dAtA []by i := len(dAtA) i -= len(m.JsonPayload) copy(dAtA[i:], m.JsonPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JsonPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JsonPayload))) i-- dAtA[i] = 0x22 return len(dAtA) - i, nil @@ -1263,7 +1264,7 @@ func (m *ConformanceResponse_Skipped) MarshalToSizedBufferVTStrict(dAtA []byte) i := len(dAtA) i -= len(m.Skipped) copy(dAtA[i:], m.Skipped) - i = encodeVarint(dAtA, i, uint64(len(m.Skipped))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Skipped))) i-- dAtA[i] = 0x2a return len(dAtA) - i, nil @@ -1277,7 +1278,7 @@ func (m *ConformanceResponse_SerializeError) MarshalToSizedBufferVTStrict(dAtA [ i := len(dAtA) i -= len(m.SerializeError) copy(dAtA[i:], m.SerializeError) - i = encodeVarint(dAtA, i, uint64(len(m.SerializeError))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SerializeError))) i-- dAtA[i] = 0x32 return len(dAtA) - i, nil @@ -1291,7 +1292,7 @@ func (m *ConformanceResponse_JspbPayload) MarshalToSizedBufferVTStrict(dAtA []by i := len(dAtA) i -= len(m.JspbPayload) copy(dAtA[i:], m.JspbPayload) - i = encodeVarint(dAtA, i, uint64(len(m.JspbPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JspbPayload))) i-- dAtA[i] = 0x3a return len(dAtA) - i, nil @@ -1305,7 +1306,7 @@ func (m *ConformanceResponse_TextPayload) MarshalToSizedBufferVTStrict(dAtA []by i := len(dAtA) i -= len(m.TextPayload) copy(dAtA[i:], m.TextPayload) - i = encodeVarint(dAtA, i, uint64(len(m.TextPayload))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TextPayload))) i-- dAtA[i] = 0x42 return len(dAtA) - i, nil @@ -1362,7 +1363,7 @@ func (m *FailureSet) SizeVT() (n int) { if len(m.Failure) > 0 { for _, s := range m.Failure { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1379,18 +1380,18 @@ func (m *ConformanceRequest) SizeVT() (n int) { n += vtmsg.SizeVT() } if m.RequestedOutputFormat != 0 { - n += 1 + sov(uint64(m.RequestedOutputFormat)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestedOutputFormat)) } l = len(m.MessageType) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.TestCategory != 0 { - n += 1 + sov(uint64(m.TestCategory)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TestCategory)) } if m.JspbEncodingOptions != nil { l = m.JspbEncodingOptions.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.PrintUnknownFields { n += 2 @@ -1406,7 +1407,7 @@ func (m *ConformanceRequest_ProtobufPayload) SizeVT() (n int) { var l int _ = l l = len(m.ProtobufPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceRequest_JsonPayload) SizeVT() (n int) { @@ -1416,7 +1417,7 @@ func (m *ConformanceRequest_JsonPayload) SizeVT() (n int) { var l int _ = l l = len(m.JsonPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceRequest_JspbPayload) SizeVT() (n int) { @@ -1426,7 +1427,7 @@ func (m *ConformanceRequest_JspbPayload) SizeVT() (n int) { var l int _ = l l = len(m.JspbPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceRequest_TextPayload) SizeVT() (n int) { @@ -1436,7 +1437,7 @@ func (m *ConformanceRequest_TextPayload) SizeVT() (n int) { var l int _ = l l = len(m.TextPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse) SizeVT() (n int) { @@ -1459,7 +1460,7 @@ func (m *ConformanceResponse_ParseError) SizeVT() (n int) { var l int _ = l l = len(m.ParseError) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse_RuntimeError) SizeVT() (n int) { @@ -1469,7 +1470,7 @@ func (m *ConformanceResponse_RuntimeError) SizeVT() (n int) { var l int _ = l l = len(m.RuntimeError) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse_ProtobufPayload) SizeVT() (n int) { @@ -1479,7 +1480,7 @@ func (m *ConformanceResponse_ProtobufPayload) SizeVT() (n int) { var l int _ = l l = len(m.ProtobufPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse_JsonPayload) SizeVT() (n int) { @@ -1489,7 +1490,7 @@ func (m *ConformanceResponse_JsonPayload) SizeVT() (n int) { var l int _ = l l = len(m.JsonPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse_Skipped) SizeVT() (n int) { @@ -1499,7 +1500,7 @@ func (m *ConformanceResponse_Skipped) SizeVT() (n int) { var l int _ = l l = len(m.Skipped) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse_SerializeError) SizeVT() (n int) { @@ -1509,7 +1510,7 @@ func (m *ConformanceResponse_SerializeError) SizeVT() (n int) { var l int _ = l l = len(m.SerializeError) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse_JspbPayload) SizeVT() (n int) { @@ -1519,7 +1520,7 @@ func (m *ConformanceResponse_JspbPayload) SizeVT() (n int) { var l int _ = l l = len(m.JspbPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *ConformanceResponse_TextPayload) SizeVT() (n int) { @@ -1529,7 +1530,7 @@ func (m *ConformanceResponse_TextPayload) SizeVT() (n int) { var l int _ = l l = len(m.TextPayload) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *JspbEncodingConfig) SizeVT() (n int) { @@ -1553,7 +1554,7 @@ func (m *FailureSet) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1581,7 +1582,7 @@ func (m *FailureSet) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1595,11 +1596,11 @@ func (m *FailureSet) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1608,12 +1609,12 @@ func (m *FailureSet) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1636,7 +1637,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1664,7 +1665,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1677,11 +1678,11 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1697,7 +1698,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1711,11 +1712,11 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1729,7 +1730,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { m.RequestedOutputFormat = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1748,7 +1749,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1762,11 +1763,11 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1780,7 +1781,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { m.TestCategory = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1799,7 +1800,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1812,11 +1813,11 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1835,7 +1836,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1849,11 +1850,11 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1867,7 +1868,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1881,11 +1882,11 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1899,7 +1900,7 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1914,12 +1915,12 @@ func (m *ConformanceRequest) UnmarshalVT(dAtA []byte) error { m.PrintUnknownFields = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1942,7 +1943,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1970,7 +1971,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1984,11 +1985,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2002,7 +2003,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2016,11 +2017,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2034,7 +2035,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2047,11 +2048,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2067,7 +2068,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2081,11 +2082,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2099,7 +2100,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2113,11 +2114,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2131,7 +2132,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2145,11 +2146,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2163,7 +2164,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2177,11 +2178,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2195,7 +2196,7 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2209,11 +2210,11 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2222,12 +2223,12 @@ func (m *ConformanceResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2250,7 +2251,7 @@ func (m *JspbEncodingConfig) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2278,7 +2279,7 @@ func (m *JspbEncodingConfig) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2293,12 +2294,12 @@ func (m *JspbEncodingConfig) UnmarshalVT(dAtA []byte) error { m.UseJspbArrayAnyFormat = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2321,7 +2322,7 @@ func (m *FailureSet) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2349,7 +2350,7 @@ func (m *FailureSet) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2363,11 +2364,11 @@ func (m *FailureSet) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2376,12 +2377,12 @@ func (m *FailureSet) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2404,7 +2405,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2432,7 +2433,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2445,11 +2446,11 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2464,7 +2465,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2478,11 +2479,11 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2496,7 +2497,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { m.RequestedOutputFormat = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2515,7 +2516,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2529,11 +2530,11 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2547,7 +2548,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { m.TestCategory = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2566,7 +2567,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2579,11 +2580,11 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2602,7 +2603,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2616,11 +2617,11 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2634,7 +2635,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2648,11 +2649,11 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2666,7 +2667,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2681,12 +2682,12 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { m.PrintUnknownFields = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2709,7 +2710,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2737,7 +2738,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2751,11 +2752,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2769,7 +2770,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2783,11 +2784,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2801,7 +2802,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2814,11 +2815,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2833,7 +2834,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2847,11 +2848,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2865,7 +2866,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2879,11 +2880,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2897,7 +2898,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2911,11 +2912,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2929,7 +2930,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2943,11 +2944,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2961,7 +2962,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2975,11 +2976,11 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2988,12 +2989,12 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3016,7 +3017,7 @@ func (m *JspbEncodingConfig) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3044,7 +3045,7 @@ func (m *JspbEncodingConfig) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3059,12 +3060,12 @@ func (m *JspbEncodingConfig) UnmarshalVTUnsafe(dAtA []byte) error { m.UseJspbArrayAnyFormat = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go index 0cd390d..88f5f11 100644 --- a/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go @@ -7,11 +7,11 @@ package conformance import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" math "math" - bits "math/bits" unsafe "unsafe" ) @@ -2279,12 +2279,12 @@ func (m *TestAllTypesProto2_NestedMessage) MarshalToSizedBufferVT(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if m.A != nil { - i = encodeVarint(dAtA, i, uint64(*m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.A)) i-- dAtA[i] = 0x8 } @@ -2322,14 +2322,14 @@ func (m *TestAllTypesProto2_Data) MarshalToSizedBufferVT(dAtA []byte) (int, erro copy(dAtA[i:], m.unknownFields) } if m.GroupUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.GroupUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.GroupUint32)) i-- dAtA[i] = 0xc i-- dAtA[i] = 0xd8 } if m.GroupInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.GroupInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.GroupInt32)) i-- dAtA[i] = 0xc i-- @@ -2404,7 +2404,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) MarshalToSizedBufferVT( if m.Str != nil { i -= len(*m.Str) copy(dAtA[i:], *m.Str) - i = encodeVarint(dAtA, i, uint64(len(*m.Str))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.Str))) i-- dAtA[i] = 0x1 i-- @@ -2444,7 +2444,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) MarshalToSizedBufferVT( copy(dAtA[i:], m.unknownFields) } if m.I != nil { - i = encodeVarint(dAtA, i, uint64(*m.I)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.I)) i-- dAtA[i] = 0x48 } @@ -2491,126 +2491,126 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= size } if m.FieldName18__ != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName18__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName18__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x90 } if m.FieldName17__ != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName17__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName17__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x88 } if m.Field__Name16 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field__Name16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field__Name16)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x80 } if m.Field_Name15 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name15)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name15)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf8 } if m.X_FieldName14 != nil { - i = encodeVarint(dAtA, i, uint64(*m.X_FieldName14)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.X_FieldName14)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf0 } if m.XFieldName13 != nil { - i = encodeVarint(dAtA, i, uint64(*m.XFieldName13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.XFieldName13)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe8 } if m.FIELDName12 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FIELDName12)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FIELDName12)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe0 } if m.FIELD_NAME11 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FIELD_NAME11)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FIELD_NAME11)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd8 } if m.Field_Name10 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name10)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd0 } if m.Field_Name9 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name9)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name9)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc8 } if m.FieldName8 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName8)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc0 } if m.FieldName7 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName7)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName7)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb8 } if m.Field_0Name6 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_0Name6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_0Name6)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb0 } if m.Field0Name5 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field0Name5)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field0Name5)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa8 } if m.Field_Name4_ != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name4_)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name4_)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa0 } if m.XFieldName3 != nil { - i = encodeVarint(dAtA, i, uint64(*m.XFieldName3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.XFieldName3)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x98 } if m.FieldName2 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName2)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x90 } if m.Fieldname1 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Fieldname1)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Fieldname1)) i-- dAtA[i] = 0x19 i-- @@ -2619,7 +2619,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.DefaultBytes != nil { i -= len(m.DefaultBytes) copy(dAtA[i:], m.DefaultBytes) - i = encodeVarint(dAtA, i, uint64(len(m.DefaultBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DefaultBytes))) i-- dAtA[i] = 0xf i-- @@ -2628,7 +2628,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.DefaultString != nil { i -= len(*m.DefaultString) copy(dAtA[i:], *m.DefaultString) - i = encodeVarint(dAtA, i, uint64(len(*m.DefaultString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.DefaultString))) i-- dAtA[i] = 0xf i-- @@ -2695,42 +2695,42 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0xbd } if m.DefaultSint64 != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.DefaultSint64)<<1)^uint64((*m.DefaultSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.DefaultSint64)<<1)^uint64((*m.DefaultSint64>>63)))) i-- dAtA[i] = 0xf i-- dAtA[i] = 0xb0 } if m.DefaultSint32 != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.DefaultSint32)<<1)^uint32((*m.DefaultSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.DefaultSint32)<<1)^uint32((*m.DefaultSint32>>31)))) i-- dAtA[i] = 0xf i-- dAtA[i] = 0xa8 } if m.DefaultUint64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultUint64)) i-- dAtA[i] = 0xf i-- dAtA[i] = 0xa0 } if m.DefaultUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultUint32)) i-- dAtA[i] = 0xf i-- dAtA[i] = 0x98 } if m.DefaultInt64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultInt64)) i-- dAtA[i] = 0xf i-- dAtA[i] = 0x90 } if m.DefaultInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultInt32)) i-- dAtA[i] = 0xf i-- @@ -2753,7 +2753,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedNestedEnum) > 0 { for iNdEx := len(m.UnpackedNestedEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) i-- dAtA[i] = 0x6 i-- @@ -2839,7 +2839,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.UnpackedSint64) > 0 { for iNdEx := len(m.UnpackedSint64) - 1; iNdEx >= 0; iNdEx-- { x3 := (uint64(m.UnpackedSint64[iNdEx]) << 1) ^ uint64((m.UnpackedSint64[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x3)) i-- dAtA[i] = 0x5 i-- @@ -2849,7 +2849,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.UnpackedSint32) > 0 { for iNdEx := len(m.UnpackedSint32) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint32(m.UnpackedSint32[iNdEx]) << 1) ^ uint32((m.UnpackedSint32[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x5 i-- @@ -2858,7 +2858,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedUint64) > 0 { for iNdEx := len(m.UnpackedUint64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2867,7 +2867,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedUint32) > 0 { for iNdEx := len(m.UnpackedUint32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2876,7 +2876,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedInt64) > 0 { for iNdEx := len(m.UnpackedInt64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2885,7 +2885,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedInt32) > 0 { for iNdEx := len(m.UnpackedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2895,7 +2895,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedNestedEnum) > 0 { var pksize6 int for _, num := range m.PackedNestedEnum { - pksize6 += sov(uint64(num)) + pksize6 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize6 j5 := i @@ -2909,7 +2909,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j5] = uint8(num) j5++ } - i = encodeVarint(dAtA, i, uint64(pksize6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize6)) i-- dAtA[i] = 0x5 i-- @@ -2924,7 +2924,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.PackedBool))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedBool))) i-- dAtA[i] = 0x5 i-- @@ -2936,7 +2936,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f7)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) i-- dAtA[i] = 0x5 i-- @@ -2948,7 +2948,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f8)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) i-- dAtA[i] = 0x5 i-- @@ -2959,7 +2959,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedSfixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -2970,7 +2970,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedSfixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -2981,7 +2981,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedFixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -2992,7 +2992,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedFixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -3001,7 +3001,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedSint64) > 0 { var pksize10 int for _, num := range m.PackedSint64 { - pksize10 += soz(uint64(num)) + pksize10 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize10 j9 := i @@ -3015,7 +3015,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j9] = uint8(x11) j9++ } - i = encodeVarint(dAtA, i, uint64(pksize10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize10)) i-- dAtA[i] = 0x5 i-- @@ -3024,7 +3024,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedSint32) > 0 { var pksize13 int for _, num := range m.PackedSint32 { - pksize13 += soz(uint64(num)) + pksize13 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize13 j12 := i @@ -3038,7 +3038,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j12] = uint8(x14) j12++ } - i = encodeVarint(dAtA, i, uint64(pksize13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize13)) i-- dAtA[i] = 0x4 i-- @@ -3047,7 +3047,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedUint64) > 0 { var pksize16 int for _, num := range m.PackedUint64 { - pksize16 += sov(uint64(num)) + pksize16 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize16 j15 := i @@ -3060,7 +3060,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j15] = uint8(num) j15++ } - i = encodeVarint(dAtA, i, uint64(pksize16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize16)) i-- dAtA[i] = 0x4 i-- @@ -3069,7 +3069,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedUint32) > 0 { var pksize18 int for _, num := range m.PackedUint32 { - pksize18 += sov(uint64(num)) + pksize18 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize18 j17 := i @@ -3082,7 +3082,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j17] = uint8(num) j17++ } - i = encodeVarint(dAtA, i, uint64(pksize18)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize18)) i-- dAtA[i] = 0x4 i-- @@ -3091,7 +3091,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedInt64) > 0 { var pksize20 int for _, num := range m.PackedInt64 { - pksize20 += sov(uint64(num)) + pksize20 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize20 j19 := i @@ -3105,7 +3105,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j19] = uint8(num) j19++ } - i = encodeVarint(dAtA, i, uint64(pksize20)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize20)) i-- dAtA[i] = 0x4 i-- @@ -3114,7 +3114,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedInt32) > 0 { var pksize22 int for _, num := range m.PackedInt32 { - pksize22 += sov(uint64(num)) + pksize22 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize22 j21 := i @@ -3128,7 +3128,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j21] = uint8(num) j21++ } - i = encodeVarint(dAtA, i, uint64(pksize22)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize22)) i-- dAtA[i] = 0x4 i-- @@ -3138,15 +3138,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapStringForeignEnum { v := m.MapStringForeignEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3157,15 +3157,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapStringNestedEnum { v := m.MapStringNestedEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3181,15 +3181,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3205,15 +3205,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3226,15 +3226,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3247,15 +3247,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3282,7 +3282,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3297,10 +3297,10 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(v)))) i-- dAtA[i] = 0x11 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3315,10 +3315,10 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(v)))) i-- dAtA[i] = 0x15 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3337,7 +3337,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3356,7 +3356,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3375,7 +3375,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3394,7 +3394,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3405,13 +3405,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapSint64Sint64 { v := m.MapSint64Sint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3422,13 +3422,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapSint32Sint32 { v := m.MapSint32Sint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3439,13 +3439,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapUint64Uint64 { v := m.MapUint64Uint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3456,13 +3456,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapUint32Uint32 { v := m.MapUint32Uint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3473,13 +3473,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapInt64Int64 { v := m.MapInt64Int64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3490,13 +3490,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapInt32Int32 { v := m.MapInt32Int32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3507,7 +3507,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedCord) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedCord[iNdEx]) copy(dAtA[i:], m.RepeatedCord[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -3518,7 +3518,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedStringPiece) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedStringPiece[iNdEx]) copy(dAtA[i:], m.RepeatedStringPiece[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -3527,7 +3527,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedForeignEnum) > 0 { for iNdEx := len(m.RepeatedForeignEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedForeignEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedForeignEnum[iNdEx])) i-- dAtA[i] = 0x3 i-- @@ -3536,7 +3536,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedNestedEnum) > 0 { for iNdEx := len(m.RepeatedNestedEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedNestedEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedNestedEnum[iNdEx])) i-- dAtA[i] = 0x3 i-- @@ -3550,7 +3550,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -3564,7 +3564,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -3575,7 +3575,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedBytes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedBytes[iNdEx]) copy(dAtA[i:], m.RepeatedBytes[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -3586,7 +3586,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedString) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedString[iNdEx]) copy(dAtA[i:], m.RepeatedString[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -3672,7 +3672,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedSint64) > 0 { for iNdEx := len(m.RepeatedSint64) - 1; iNdEx >= 0; iNdEx-- { x25 := (uint64(m.RepeatedSint64[iNdEx]) << 1) ^ uint64((m.RepeatedSint64[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x25)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x25)) i-- dAtA[i] = 0x2 i-- @@ -3682,7 +3682,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedSint32) > 0 { for iNdEx := len(m.RepeatedSint32) - 1; iNdEx >= 0; iNdEx-- { x26 := (uint32(m.RepeatedSint32[iNdEx]) << 1) ^ uint32((m.RepeatedSint32[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x26)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x26)) i-- dAtA[i] = 0x2 i-- @@ -3691,7 +3691,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedUint64) > 0 { for iNdEx := len(m.RepeatedUint64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedUint64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedUint64[iNdEx])) i-- dAtA[i] = 0x2 i-- @@ -3700,7 +3700,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedUint32) > 0 { for iNdEx := len(m.RepeatedUint32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedUint32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedUint32[iNdEx])) i-- dAtA[i] = 0x2 i-- @@ -3709,7 +3709,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedInt64) > 0 { for iNdEx := len(m.RepeatedInt64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedInt64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedInt64[iNdEx])) i-- dAtA[i] = 0x2 i-- @@ -3718,7 +3718,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.RepeatedInt32) > 0 { for iNdEx := len(m.RepeatedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) i-- dAtA[i] = 0x1 i-- @@ -3731,7 +3731,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -3740,7 +3740,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.OptionalCord != nil { i -= len(*m.OptionalCord) copy(dAtA[i:], *m.OptionalCord) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalCord))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalCord))) i-- dAtA[i] = 0x1 i-- @@ -3749,21 +3749,21 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.OptionalStringPiece != nil { i -= len(*m.OptionalStringPiece) copy(dAtA[i:], *m.OptionalStringPiece) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalStringPiece))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalStringPiece))) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xc2 } if m.OptionalForeignEnum != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalForeignEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalForeignEnum)) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xb0 } if m.OptionalNestedEnum != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalNestedEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalNestedEnum)) i-- dAtA[i] = 0x1 i-- @@ -3775,7 +3775,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -3787,7 +3787,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -3796,14 +3796,14 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.OptionalBytes != nil { i -= len(m.OptionalBytes) copy(dAtA[i:], m.OptionalBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) i-- dAtA[i] = 0x7a } if m.OptionalString != nil { i -= len(*m.OptionalString) copy(dAtA[i:], *m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalString))) i-- dAtA[i] = 0x72 } @@ -3854,32 +3854,32 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x3d } if m.OptionalSint64 != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) i-- dAtA[i] = 0x30 } if m.OptionalSint32 != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) i-- dAtA[i] = 0x28 } if m.OptionalUint64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint64)) i-- dAtA[i] = 0x20 } if m.OptionalUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint32)) i-- dAtA[i] = 0x18 } if m.OptionalInt64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt64)) i-- dAtA[i] = 0x10 } if m.OptionalInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt32)) i-- dAtA[i] = 0x8 } @@ -3893,7 +3893,7 @@ func (m *TestAllTypesProto2_OneofUint32) MarshalToVT(dAtA []byte) (int, error) { func (m *TestAllTypesProto2_OneofUint32) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint32)) i-- dAtA[i] = 0x6 i-- @@ -3913,7 +3913,7 @@ func (m *TestAllTypesProto2_OneofNestedMessage) MarshalToSizedBufferVT(dAtA []by return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -3930,7 +3930,7 @@ func (m *TestAllTypesProto2_OneofString) MarshalToSizedBufferVT(dAtA []byte) (in i := len(dAtA) i -= len(m.OneofString) copy(dAtA[i:], m.OneofString) - i = encodeVarint(dAtA, i, uint64(len(m.OneofString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofString))) i-- dAtA[i] = 0x7 i-- @@ -3946,7 +3946,7 @@ func (m *TestAllTypesProto2_OneofBytes) MarshalToSizedBufferVT(dAtA []byte) (int i := len(dAtA) i -= len(m.OneofBytes) copy(dAtA[i:], m.OneofBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OneofBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofBytes))) i-- dAtA[i] = 0x7 i-- @@ -3979,7 +3979,7 @@ func (m *TestAllTypesProto2_OneofUint64) MarshalToVT(dAtA []byte) (int, error) { func (m *TestAllTypesProto2_OneofUint64) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint64)) i-- dAtA[i] = 0x7 i-- @@ -4023,7 +4023,7 @@ func (m *TestAllTypesProto2_OneofEnum) MarshalToVT(dAtA []byte) (int, error) { func (m *TestAllTypesProto2_OneofEnum) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofEnum)) i-- dAtA[i] = 0x7 i-- @@ -4061,7 +4061,7 @@ func (m *ForeignMessageProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if m.C != nil { - i = encodeVarint(dAtA, i, uint64(*m.C)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.C)) i-- dAtA[i] = 0x8 } @@ -4099,7 +4099,7 @@ func (m *UnknownToTestAllTypes_OptionalGroup) MarshalToSizedBufferVT(dAtA []byte copy(dAtA[i:], m.unknownFields) } if m.A != nil { - i = encodeVarint(dAtA, i, uint64(*m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.A)) i-- dAtA[i] = 0x8 } @@ -4138,7 +4138,7 @@ func (m *UnknownToTestAllTypes) MarshalToSizedBufferVT(dAtA []byte) (int, error) } if len(m.RepeatedInt32) > 0 { for iNdEx := len(m.RepeatedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) i-- dAtA[i] = 0x3f i-- @@ -4178,7 +4178,7 @@ func (m *UnknownToTestAllTypes) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3e i-- @@ -4187,14 +4187,14 @@ func (m *UnknownToTestAllTypes) MarshalToSizedBufferVT(dAtA []byte) (int, error) if m.OptionalString != nil { i -= len(*m.OptionalString) copy(dAtA[i:], *m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalString))) i-- dAtA[i] = 0x3e i-- dAtA[i] = 0xd2 } if m.OptionalInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt32)) i-- dAtA[i] = 0x3e i-- @@ -4302,24 +4302,13 @@ func (m *OneStringProto2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.Data != nil { i -= len(*m.Data) copy(dAtA[i:], *m.Data) - i = encodeVarint(dAtA, i, uint64(len(*m.Data))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.Data))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *TestAllTypesProto2_NestedMessage) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -4356,12 +4345,12 @@ func (m *TestAllTypesProto2_NestedMessage) MarshalToSizedBufferVTStrict(dAtA []b return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if m.A != nil { - i = encodeVarint(dAtA, i, uint64(*m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.A)) i-- dAtA[i] = 0x8 } @@ -4399,14 +4388,14 @@ func (m *TestAllTypesProto2_Data) MarshalToSizedBufferVTStrict(dAtA []byte) (int copy(dAtA[i:], m.unknownFields) } if m.GroupUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.GroupUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.GroupUint32)) i-- dAtA[i] = 0xc i-- dAtA[i] = 0xd8 } if m.GroupInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.GroupInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.GroupInt32)) i-- dAtA[i] = 0xc i-- @@ -4481,7 +4470,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) MarshalToSizedBufferVTS if m.Str != nil { i -= len(*m.Str) copy(dAtA[i:], *m.Str) - i = encodeVarint(dAtA, i, uint64(len(*m.Str))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.Str))) i-- dAtA[i] = 0x1 i-- @@ -4521,7 +4510,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) MarshalToSizedBufferVTS copy(dAtA[i:], m.unknownFields) } if m.I != nil { - i = encodeVarint(dAtA, i, uint64(*m.I)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.I)) i-- dAtA[i] = 0x48 } @@ -4559,126 +4548,126 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err copy(dAtA[i:], m.unknownFields) } if m.FieldName18__ != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName18__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName18__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x90 } if m.FieldName17__ != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName17__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName17__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x88 } if m.Field__Name16 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field__Name16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field__Name16)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x80 } if m.Field_Name15 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name15)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name15)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf8 } if m.X_FieldName14 != nil { - i = encodeVarint(dAtA, i, uint64(*m.X_FieldName14)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.X_FieldName14)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf0 } if m.XFieldName13 != nil { - i = encodeVarint(dAtA, i, uint64(*m.XFieldName13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.XFieldName13)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe8 } if m.FIELDName12 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FIELDName12)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FIELDName12)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe0 } if m.FIELD_NAME11 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FIELD_NAME11)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FIELD_NAME11)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd8 } if m.Field_Name10 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name10)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd0 } if m.Field_Name9 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name9)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name9)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc8 } if m.FieldName8 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName8)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc0 } if m.FieldName7 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName7)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName7)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb8 } if m.Field_0Name6 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_0Name6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_0Name6)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb0 } if m.Field0Name5 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field0Name5)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field0Name5)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa8 } if m.Field_Name4_ != nil { - i = encodeVarint(dAtA, i, uint64(*m.Field_Name4_)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Field_Name4_)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa0 } if m.XFieldName3 != nil { - i = encodeVarint(dAtA, i, uint64(*m.XFieldName3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.XFieldName3)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x98 } if m.FieldName2 != nil { - i = encodeVarint(dAtA, i, uint64(*m.FieldName2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FieldName2)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x90 } if m.Fieldname1 != nil { - i = encodeVarint(dAtA, i, uint64(*m.Fieldname1)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Fieldname1)) i-- dAtA[i] = 0x19 i-- @@ -4687,7 +4676,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if m.DefaultBytes != nil { i -= len(m.DefaultBytes) copy(dAtA[i:], m.DefaultBytes) - i = encodeVarint(dAtA, i, uint64(len(m.DefaultBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DefaultBytes))) i-- dAtA[i] = 0xf i-- @@ -4696,7 +4685,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if m.DefaultString != nil { i -= len(*m.DefaultString) copy(dAtA[i:], *m.DefaultString) - i = encodeVarint(dAtA, i, uint64(len(*m.DefaultString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.DefaultString))) i-- dAtA[i] = 0xf i-- @@ -4763,42 +4752,42 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0xbd } if m.DefaultSint64 != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.DefaultSint64)<<1)^uint64((*m.DefaultSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.DefaultSint64)<<1)^uint64((*m.DefaultSint64>>63)))) i-- dAtA[i] = 0xf i-- dAtA[i] = 0xb0 } if m.DefaultSint32 != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.DefaultSint32)<<1)^uint32((*m.DefaultSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.DefaultSint32)<<1)^uint32((*m.DefaultSint32>>31)))) i-- dAtA[i] = 0xf i-- dAtA[i] = 0xa8 } if m.DefaultUint64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultUint64)) i-- dAtA[i] = 0xf i-- dAtA[i] = 0xa0 } if m.DefaultUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultUint32)) i-- dAtA[i] = 0xf i-- dAtA[i] = 0x98 } if m.DefaultInt64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultInt64)) i-- dAtA[i] = 0xf i-- dAtA[i] = 0x90 } if m.DefaultInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.DefaultInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.DefaultInt32)) i-- dAtA[i] = 0xf i-- @@ -4884,7 +4873,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedNestedEnum) > 0 { for iNdEx := len(m.UnpackedNestedEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) i-- dAtA[i] = 0x6 i-- @@ -4970,7 +4959,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.UnpackedSint64) > 0 { for iNdEx := len(m.UnpackedSint64) - 1; iNdEx >= 0; iNdEx-- { x3 := (uint64(m.UnpackedSint64[iNdEx]) << 1) ^ uint64((m.UnpackedSint64[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x3)) i-- dAtA[i] = 0x5 i-- @@ -4980,7 +4969,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.UnpackedSint32) > 0 { for iNdEx := len(m.UnpackedSint32) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint32(m.UnpackedSint32[iNdEx]) << 1) ^ uint32((m.UnpackedSint32[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x5 i-- @@ -4989,7 +4978,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedUint64) > 0 { for iNdEx := len(m.UnpackedUint64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -4998,7 +4987,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedUint32) > 0 { for iNdEx := len(m.UnpackedUint32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -5007,7 +4996,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedInt64) > 0 { for iNdEx := len(m.UnpackedInt64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -5016,7 +5005,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedInt32) > 0 { for iNdEx := len(m.UnpackedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -5026,7 +5015,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedNestedEnum) > 0 { var pksize6 int for _, num := range m.PackedNestedEnum { - pksize6 += sov(uint64(num)) + pksize6 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize6 j5 := i @@ -5040,7 +5029,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j5] = uint8(num) j5++ } - i = encodeVarint(dAtA, i, uint64(pksize6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize6)) i-- dAtA[i] = 0x5 i-- @@ -5055,7 +5044,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.PackedBool))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedBool))) i-- dAtA[i] = 0x5 i-- @@ -5067,7 +5056,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f7)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) i-- dAtA[i] = 0x5 i-- @@ -5079,7 +5068,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f8)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) i-- dAtA[i] = 0x5 i-- @@ -5090,7 +5079,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedSfixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -5101,7 +5090,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedSfixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -5112,7 +5101,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedFixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -5123,7 +5112,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedFixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -5132,7 +5121,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedSint64) > 0 { var pksize10 int for _, num := range m.PackedSint64 { - pksize10 += soz(uint64(num)) + pksize10 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize10 j9 := i @@ -5146,7 +5135,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j9] = uint8(x11) j9++ } - i = encodeVarint(dAtA, i, uint64(pksize10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize10)) i-- dAtA[i] = 0x5 i-- @@ -5155,7 +5144,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedSint32) > 0 { var pksize13 int for _, num := range m.PackedSint32 { - pksize13 += soz(uint64(num)) + pksize13 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize13 j12 := i @@ -5169,7 +5158,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j12] = uint8(x14) j12++ } - i = encodeVarint(dAtA, i, uint64(pksize13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize13)) i-- dAtA[i] = 0x4 i-- @@ -5178,7 +5167,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedUint64) > 0 { var pksize16 int for _, num := range m.PackedUint64 { - pksize16 += sov(uint64(num)) + pksize16 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize16 j15 := i @@ -5191,7 +5180,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j15] = uint8(num) j15++ } - i = encodeVarint(dAtA, i, uint64(pksize16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize16)) i-- dAtA[i] = 0x4 i-- @@ -5200,7 +5189,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedUint32) > 0 { var pksize18 int for _, num := range m.PackedUint32 { - pksize18 += sov(uint64(num)) + pksize18 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize18 j17 := i @@ -5213,7 +5202,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j17] = uint8(num) j17++ } - i = encodeVarint(dAtA, i, uint64(pksize18)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize18)) i-- dAtA[i] = 0x4 i-- @@ -5222,7 +5211,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedInt64) > 0 { var pksize20 int for _, num := range m.PackedInt64 { - pksize20 += sov(uint64(num)) + pksize20 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize20 j19 := i @@ -5236,7 +5225,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j19] = uint8(num) j19++ } - i = encodeVarint(dAtA, i, uint64(pksize20)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize20)) i-- dAtA[i] = 0x4 i-- @@ -5245,7 +5234,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedInt32) > 0 { var pksize22 int for _, num := range m.PackedInt32 { - pksize22 += sov(uint64(num)) + pksize22 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize22 j21 := i @@ -5259,7 +5248,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j21] = uint8(num) j21++ } - i = encodeVarint(dAtA, i, uint64(pksize22)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize22)) i-- dAtA[i] = 0x4 i-- @@ -5269,15 +5258,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapStringForeignEnum { v := m.MapStringForeignEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5288,15 +5277,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapStringNestedEnum { v := m.MapStringNestedEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5312,15 +5301,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5336,15 +5325,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5357,15 +5346,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5378,15 +5367,15 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5413,7 +5402,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5428,10 +5417,10 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(v)))) i-- dAtA[i] = 0x11 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5446,10 +5435,10 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(v)))) i-- dAtA[i] = 0x15 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5468,7 +5457,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5487,7 +5476,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5506,7 +5495,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5525,7 +5514,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5536,13 +5525,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapSint64Sint64 { v := m.MapSint64Sint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5553,13 +5542,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapSint32Sint32 { v := m.MapSint32Sint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5570,13 +5559,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapUint64Uint64 { v := m.MapUint64Uint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5587,13 +5576,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapUint32Uint32 { v := m.MapUint32Uint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5604,13 +5593,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapInt64Int64 { v := m.MapInt64Int64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5621,13 +5610,13 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapInt32Int32 { v := m.MapInt32Int32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5638,7 +5627,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedCord) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedCord[iNdEx]) copy(dAtA[i:], m.RepeatedCord[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -5649,7 +5638,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedStringPiece) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedStringPiece[iNdEx]) copy(dAtA[i:], m.RepeatedStringPiece[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -5658,7 +5647,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedForeignEnum) > 0 { for iNdEx := len(m.RepeatedForeignEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedForeignEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedForeignEnum[iNdEx])) i-- dAtA[i] = 0x3 i-- @@ -5667,7 +5656,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedNestedEnum) > 0 { for iNdEx := len(m.RepeatedNestedEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedNestedEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedNestedEnum[iNdEx])) i-- dAtA[i] = 0x3 i-- @@ -5681,7 +5670,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -5695,7 +5684,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -5706,7 +5695,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedBytes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedBytes[iNdEx]) copy(dAtA[i:], m.RepeatedBytes[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -5717,7 +5706,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedString) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedString[iNdEx]) copy(dAtA[i:], m.RepeatedString[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -5803,7 +5792,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedSint64) > 0 { for iNdEx := len(m.RepeatedSint64) - 1; iNdEx >= 0; iNdEx-- { x25 := (uint64(m.RepeatedSint64[iNdEx]) << 1) ^ uint64((m.RepeatedSint64[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x25)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x25)) i-- dAtA[i] = 0x2 i-- @@ -5813,7 +5802,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedSint32) > 0 { for iNdEx := len(m.RepeatedSint32) - 1; iNdEx >= 0; iNdEx-- { x26 := (uint32(m.RepeatedSint32[iNdEx]) << 1) ^ uint32((m.RepeatedSint32[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x26)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x26)) i-- dAtA[i] = 0x2 i-- @@ -5822,7 +5811,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedUint64) > 0 { for iNdEx := len(m.RepeatedUint64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedUint64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedUint64[iNdEx])) i-- dAtA[i] = 0x2 i-- @@ -5831,7 +5820,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedUint32) > 0 { for iNdEx := len(m.RepeatedUint32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedUint32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedUint32[iNdEx])) i-- dAtA[i] = 0x2 i-- @@ -5840,7 +5829,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedInt64) > 0 { for iNdEx := len(m.RepeatedInt64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedInt64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedInt64[iNdEx])) i-- dAtA[i] = 0x2 i-- @@ -5849,7 +5838,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.RepeatedInt32) > 0 { for iNdEx := len(m.RepeatedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) i-- dAtA[i] = 0x1 i-- @@ -5862,7 +5851,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -5871,7 +5860,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if m.OptionalCord != nil { i -= len(*m.OptionalCord) copy(dAtA[i:], *m.OptionalCord) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalCord))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalCord))) i-- dAtA[i] = 0x1 i-- @@ -5880,21 +5869,21 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if m.OptionalStringPiece != nil { i -= len(*m.OptionalStringPiece) copy(dAtA[i:], *m.OptionalStringPiece) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalStringPiece))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalStringPiece))) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xc2 } if m.OptionalForeignEnum != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalForeignEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalForeignEnum)) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xb0 } if m.OptionalNestedEnum != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalNestedEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalNestedEnum)) i-- dAtA[i] = 0x1 i-- @@ -5906,7 +5895,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -5918,7 +5907,7 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -5927,14 +5916,14 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if m.OptionalBytes != nil { i -= len(m.OptionalBytes) copy(dAtA[i:], m.OptionalBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) i-- dAtA[i] = 0x7a } if m.OptionalString != nil { i -= len(*m.OptionalString) copy(dAtA[i:], *m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalString))) i-- dAtA[i] = 0x72 } @@ -5985,32 +5974,32 @@ func (m *TestAllTypesProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0x3d } if m.OptionalSint64 != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) i-- dAtA[i] = 0x30 } if m.OptionalSint32 != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) i-- dAtA[i] = 0x28 } if m.OptionalUint64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint64)) i-- dAtA[i] = 0x20 } if m.OptionalUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint32)) i-- dAtA[i] = 0x18 } if m.OptionalInt64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt64)) i-- dAtA[i] = 0x10 } if m.OptionalInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt32)) i-- dAtA[i] = 0x8 } @@ -6024,7 +6013,7 @@ func (m *TestAllTypesProto2_OneofUint32) MarshalToVTStrict(dAtA []byte) (int, er func (m *TestAllTypesProto2_OneofUint32) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint32)) i-- dAtA[i] = 0x6 i-- @@ -6044,7 +6033,7 @@ func (m *TestAllTypesProto2_OneofNestedMessage) MarshalToSizedBufferVTStrict(dAt return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -6061,7 +6050,7 @@ func (m *TestAllTypesProto2_OneofString) MarshalToSizedBufferVTStrict(dAtA []byt i := len(dAtA) i -= len(m.OneofString) copy(dAtA[i:], m.OneofString) - i = encodeVarint(dAtA, i, uint64(len(m.OneofString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofString))) i-- dAtA[i] = 0x7 i-- @@ -6077,7 +6066,7 @@ func (m *TestAllTypesProto2_OneofBytes) MarshalToSizedBufferVTStrict(dAtA []byte i := len(dAtA) i -= len(m.OneofBytes) copy(dAtA[i:], m.OneofBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OneofBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofBytes))) i-- dAtA[i] = 0x7 i-- @@ -6110,7 +6099,7 @@ func (m *TestAllTypesProto2_OneofUint64) MarshalToVTStrict(dAtA []byte) (int, er func (m *TestAllTypesProto2_OneofUint64) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint64)) i-- dAtA[i] = 0x7 i-- @@ -6154,7 +6143,7 @@ func (m *TestAllTypesProto2_OneofEnum) MarshalToVTStrict(dAtA []byte) (int, erro func (m *TestAllTypesProto2_OneofEnum) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofEnum)) i-- dAtA[i] = 0x7 i-- @@ -6192,7 +6181,7 @@ func (m *ForeignMessageProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, e copy(dAtA[i:], m.unknownFields) } if m.C != nil { - i = encodeVarint(dAtA, i, uint64(*m.C)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.C)) i-- dAtA[i] = 0x8 } @@ -6230,7 +6219,7 @@ func (m *UnknownToTestAllTypes_OptionalGroup) MarshalToSizedBufferVTStrict(dAtA copy(dAtA[i:], m.unknownFields) } if m.A != nil { - i = encodeVarint(dAtA, i, uint64(*m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.A)) i-- dAtA[i] = 0x8 } @@ -6269,7 +6258,7 @@ func (m *UnknownToTestAllTypes) MarshalToSizedBufferVTStrict(dAtA []byte) (int, } if len(m.RepeatedInt32) > 0 { for iNdEx := len(m.RepeatedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedInt32[iNdEx])) i-- dAtA[i] = 0x3f i-- @@ -6309,7 +6298,7 @@ func (m *UnknownToTestAllTypes) MarshalToSizedBufferVTStrict(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3e i-- @@ -6318,14 +6307,14 @@ func (m *UnknownToTestAllTypes) MarshalToSizedBufferVTStrict(dAtA []byte) (int, if m.OptionalString != nil { i -= len(*m.OptionalString) copy(dAtA[i:], *m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalString))) i-- dAtA[i] = 0x3e i-- dAtA[i] = 0xd2 } if m.OptionalInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt32)) i-- dAtA[i] = 0x3e i-- @@ -6433,7 +6422,7 @@ func (m *OneStringProto2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) if m.Data != nil { i -= len(*m.Data) copy(dAtA[i:], *m.Data) - i = encodeVarint(dAtA, i, uint64(len(*m.Data))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.Data))) i-- dAtA[i] = 0xa } @@ -6447,11 +6436,11 @@ func (m *TestAllTypesProto2_NestedMessage) SizeVT() (n int) { var l int _ = l if m.A != nil { - n += 1 + sov(uint64(*m.A)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.A)) } if m.Corecursive != nil { l = m.Corecursive.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -6464,10 +6453,10 @@ func (m *TestAllTypesProto2_Data) SizeVT() (n int) { var l int _ = l if m.GroupInt32 != nil { - n += 2 + sov(uint64(*m.GroupInt32)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.GroupInt32)) } if m.GroupUint32 != nil { - n += 2 + sov(uint64(*m.GroupUint32)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.GroupUint32)) } n += len(m.unknownFields) return n @@ -6491,7 +6480,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) SizeVT() (n int) { _ = l if m.Str != nil { l = len(*m.Str) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -6504,7 +6493,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) SizeVT() (n int) { var l int _ = l if m.I != nil { - n += 1 + sov(uint64(*m.I)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.I)) } n += len(m.unknownFields) return n @@ -6517,22 +6506,22 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { var l int _ = l if m.OptionalInt32 != nil { - n += 1 + sov(uint64(*m.OptionalInt32)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalInt32)) } if m.OptionalInt64 != nil { - n += 1 + sov(uint64(*m.OptionalInt64)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalInt64)) } if m.OptionalUint32 != nil { - n += 1 + sov(uint64(*m.OptionalUint32)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalUint32)) } if m.OptionalUint64 != nil { - n += 1 + sov(uint64(*m.OptionalUint64)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalUint64)) } if m.OptionalSint32 != nil { - n += 1 + soz(uint64(*m.OptionalSint32)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.OptionalSint32)) } if m.OptionalSint64 != nil { - n += 1 + soz(uint64(*m.OptionalSint64)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.OptionalSint64)) } if m.OptionalFixed32 != nil { n += 5 @@ -6557,66 +6546,66 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { } if m.OptionalString != nil { l = len(*m.OptionalString) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalBytes != nil { l = len(m.OptionalBytes) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalNestedMessage != nil { l = m.OptionalNestedMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalForeignMessage != nil { l = m.OptionalForeignMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalNestedEnum != nil { - n += 2 + sov(uint64(*m.OptionalNestedEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.OptionalNestedEnum)) } if m.OptionalForeignEnum != nil { - n += 2 + sov(uint64(*m.OptionalForeignEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.OptionalForeignEnum)) } if m.OptionalStringPiece != nil { l = len(*m.OptionalStringPiece) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalCord != nil { l = len(*m.OptionalCord) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.RecursiveMessage != nil { l = m.RecursiveMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.RepeatedInt32) > 0 { for _, e := range m.RepeatedInt32 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.RepeatedInt64) > 0 { for _, e := range m.RepeatedInt64 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.RepeatedUint32) > 0 { for _, e := range m.RepeatedUint32 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.RepeatedUint64) > 0 { for _, e := range m.RepeatedUint64 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.RepeatedSint32) > 0 { for _, e := range m.RepeatedSint32 { - n += 2 + soz(uint64(e)) + n += 2 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.RepeatedSint64) > 0 { for _, e := range m.RepeatedSint64 { - n += 2 + soz(uint64(e)) + n += 2 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.RepeatedFixed32) > 0 { @@ -6643,95 +6632,95 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { if len(m.RepeatedString) > 0 { for _, s := range m.RepeatedString { l = len(s) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedBytes) > 0 { for _, b := range m.RepeatedBytes { l = len(b) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedNestedMessage) > 0 { for _, e := range m.RepeatedNestedMessage { l = e.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedForeignMessage) > 0 { for _, e := range m.RepeatedForeignMessage { l = e.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedNestedEnum) > 0 { for _, e := range m.RepeatedNestedEnum { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.RepeatedForeignEnum) > 0 { for _, e := range m.RepeatedForeignEnum { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.RepeatedStringPiece) > 0 { for _, s := range m.RepeatedStringPiece { l = len(s) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedCord) > 0 { for _, s := range m.RepeatedCord { l = len(s) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.MapInt32Int32) > 0 { for k, v := range m.MapInt32Int32 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapInt64Int64) > 0 { for k, v := range m.MapInt64Int64 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapUint32Uint32) > 0 { for k, v := range m.MapUint32Uint32 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapUint64Uint64) > 0 { for k, v := range m.MapUint64Uint64 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSint32Sint32) > 0 { for k, v := range m.MapSint32Sint32 { _ = k _ = v - mapEntrySize := 1 + soz(uint64(k)) + 1 + soz(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfZigzag(uint64(k)) + 1 + protohelpers.SizeOfZigzag(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSint64Sint64) > 0 { for k, v := range m.MapSint64Sint64 { _ = k _ = v - mapEntrySize := 1 + soz(uint64(k)) + 1 + soz(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfZigzag(uint64(k)) + 1 + protohelpers.SizeOfZigzag(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapFixed32Fixed32) > 0 { @@ -6739,7 +6728,7 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 4 + 1 + 4 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapFixed64Fixed64) > 0 { @@ -6747,7 +6736,7 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 8 + 1 + 8 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSfixed32Sfixed32) > 0 { @@ -6755,7 +6744,7 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 4 + 1 + 4 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSfixed64Sfixed64) > 0 { @@ -6763,23 +6752,23 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 8 + 1 + 8 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapInt32Float) > 0 { for k, v := range m.MapInt32Float { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + 4 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + 4 + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapInt32Double) > 0 { for k, v := range m.MapInt32Double { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + 8 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + 8 + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapBoolBool) > 0 { @@ -6787,24 +6776,24 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 1 + 1 + 1 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringString) > 0 { for k, v := range m.MapStringString { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringBytes) > 0 { for k, v := range m.MapStringBytes { _ = k _ = v - l = 1 + len(v) + sov(uint64(len(v))) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + l = 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringNestedMessage) > 0 { @@ -6815,9 +6804,9 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { if v != nil { l = v.SizeVT() } - l += 1 + sov(uint64(l)) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringForeignMessage) > 0 { @@ -6828,125 +6817,125 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { if v != nil { l = v.SizeVT() } - l += 1 + sov(uint64(l)) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringNestedEnum) > 0 { for k, v := range m.MapStringNestedEnum { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringForeignEnum) > 0 { for k, v := range m.MapStringForeignEnum { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.PackedInt32) > 0 { l = 0 for _, e := range m.PackedInt32 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedInt64) > 0 { l = 0 for _, e := range m.PackedInt64 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedUint32) > 0 { l = 0 for _, e := range m.PackedUint32 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedUint64) > 0 { l = 0 for _, e := range m.PackedUint64 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedSint32) > 0 { l = 0 for _, e := range m.PackedSint32 { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedSint64) > 0 { l = 0 for _, e := range m.PackedSint64 { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedFixed32) > 0 { - n += 2 + sov(uint64(len(m.PackedFixed32)*4)) + len(m.PackedFixed32)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedFixed32)*4)) + len(m.PackedFixed32)*4 } if len(m.PackedFixed64) > 0 { - n += 2 + sov(uint64(len(m.PackedFixed64)*8)) + len(m.PackedFixed64)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedFixed64)*8)) + len(m.PackedFixed64)*8 } if len(m.PackedSfixed32) > 0 { - n += 2 + sov(uint64(len(m.PackedSfixed32)*4)) + len(m.PackedSfixed32)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedSfixed32)*4)) + len(m.PackedSfixed32)*4 } if len(m.PackedSfixed64) > 0 { - n += 2 + sov(uint64(len(m.PackedSfixed64)*8)) + len(m.PackedSfixed64)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedSfixed64)*8)) + len(m.PackedSfixed64)*8 } if len(m.PackedFloat) > 0 { - n += 2 + sov(uint64(len(m.PackedFloat)*4)) + len(m.PackedFloat)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedFloat)*4)) + len(m.PackedFloat)*4 } if len(m.PackedDouble) > 0 { - n += 2 + sov(uint64(len(m.PackedDouble)*8)) + len(m.PackedDouble)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedDouble)*8)) + len(m.PackedDouble)*8 } if len(m.PackedBool) > 0 { - n += 2 + sov(uint64(len(m.PackedBool))) + len(m.PackedBool)*1 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedBool))) + len(m.PackedBool)*1 } if len(m.PackedNestedEnum) > 0 { l = 0 for _, e := range m.PackedNestedEnum { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.UnpackedInt32) > 0 { for _, e := range m.UnpackedInt32 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedInt64) > 0 { for _, e := range m.UnpackedInt64 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedUint32) > 0 { for _, e := range m.UnpackedUint32 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedUint64) > 0 { for _, e := range m.UnpackedUint64 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedSint32) > 0 { for _, e := range m.UnpackedSint32 { - n += 2 + soz(uint64(e)) + n += 2 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.UnpackedSint64) > 0 { for _, e := range m.UnpackedSint64 { - n += 2 + soz(uint64(e)) + n += 2 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.UnpackedFixed32) > 0 { @@ -6972,7 +6961,7 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { } if len(m.UnpackedNestedEnum) > 0 { for _, e := range m.UnpackedNestedEnum { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if vtmsg, ok := m.OneofField.(interface{ SizeVT() int }); ok { @@ -6983,22 +6972,22 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { n += l + 4 } if m.DefaultInt32 != nil { - n += 2 + sov(uint64(*m.DefaultInt32)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.DefaultInt32)) } if m.DefaultInt64 != nil { - n += 2 + sov(uint64(*m.DefaultInt64)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.DefaultInt64)) } if m.DefaultUint32 != nil { - n += 2 + sov(uint64(*m.DefaultUint32)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.DefaultUint32)) } if m.DefaultUint64 != nil { - n += 2 + sov(uint64(*m.DefaultUint64)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.DefaultUint64)) } if m.DefaultSint32 != nil { - n += 2 + soz(uint64(*m.DefaultSint32)) + n += 2 + protohelpers.SizeOfZigzag(uint64(*m.DefaultSint32)) } if m.DefaultSint64 != nil { - n += 2 + soz(uint64(*m.DefaultSint64)) + n += 2 + protohelpers.SizeOfZigzag(uint64(*m.DefaultSint64)) } if m.DefaultFixed32 != nil { n += 6 @@ -7023,65 +7012,65 @@ func (m *TestAllTypesProto2) SizeVT() (n int) { } if m.DefaultString != nil { l = len(*m.DefaultString) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.DefaultBytes != nil { l = len(m.DefaultBytes) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Fieldname1 != nil { - n += 2 + sov(uint64(*m.Fieldname1)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Fieldname1)) } if m.FieldName2 != nil { - n += 2 + sov(uint64(*m.FieldName2)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.FieldName2)) } if m.XFieldName3 != nil { - n += 2 + sov(uint64(*m.XFieldName3)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.XFieldName3)) } if m.Field_Name4_ != nil { - n += 2 + sov(uint64(*m.Field_Name4_)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Field_Name4_)) } if m.Field0Name5 != nil { - n += 2 + sov(uint64(*m.Field0Name5)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Field0Name5)) } if m.Field_0Name6 != nil { - n += 2 + sov(uint64(*m.Field_0Name6)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Field_0Name6)) } if m.FieldName7 != nil { - n += 2 + sov(uint64(*m.FieldName7)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.FieldName7)) } if m.FieldName8 != nil { - n += 2 + sov(uint64(*m.FieldName8)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.FieldName8)) } if m.Field_Name9 != nil { - n += 2 + sov(uint64(*m.Field_Name9)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Field_Name9)) } if m.Field_Name10 != nil { - n += 2 + sov(uint64(*m.Field_Name10)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Field_Name10)) } if m.FIELD_NAME11 != nil { - n += 2 + sov(uint64(*m.FIELD_NAME11)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.FIELD_NAME11)) } if m.FIELDName12 != nil { - n += 2 + sov(uint64(*m.FIELDName12)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.FIELDName12)) } if m.XFieldName13 != nil { - n += 2 + sov(uint64(*m.XFieldName13)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.XFieldName13)) } if m.X_FieldName14 != nil { - n += 2 + sov(uint64(*m.X_FieldName14)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.X_FieldName14)) } if m.Field_Name15 != nil { - n += 2 + sov(uint64(*m.Field_Name15)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Field_Name15)) } if m.Field__Name16 != nil { - n += 2 + sov(uint64(*m.Field__Name16)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.Field__Name16)) } if m.FieldName17__ != nil { - n += 2 + sov(uint64(*m.FieldName17__)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.FieldName17__)) } if m.FieldName18__ != nil { - n += 2 + sov(uint64(*m.FieldName18__)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.FieldName18__)) } n += len(m.unknownFields) return n @@ -7093,7 +7082,7 @@ func (m *TestAllTypesProto2_OneofUint32) SizeVT() (n int) { } var l int _ = l - n += 2 + sov(uint64(m.OneofUint32)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OneofUint32)) return n } func (m *TestAllTypesProto2_OneofNestedMessage) SizeVT() (n int) { @@ -7104,7 +7093,7 @@ func (m *TestAllTypesProto2_OneofNestedMessage) SizeVT() (n int) { _ = l if m.OneofNestedMessage != nil { l = m.OneofNestedMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -7115,7 +7104,7 @@ func (m *TestAllTypesProto2_OneofString) SizeVT() (n int) { var l int _ = l l = len(m.OneofString) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *TestAllTypesProto2_OneofBytes) SizeVT() (n int) { @@ -7125,7 +7114,7 @@ func (m *TestAllTypesProto2_OneofBytes) SizeVT() (n int) { var l int _ = l l = len(m.OneofBytes) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *TestAllTypesProto2_OneofBool) SizeVT() (n int) { @@ -7143,7 +7132,7 @@ func (m *TestAllTypesProto2_OneofUint64) SizeVT() (n int) { } var l int _ = l - n += 2 + sov(uint64(m.OneofUint64)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OneofUint64)) return n } func (m *TestAllTypesProto2_OneofFloat) SizeVT() (n int) { @@ -7170,7 +7159,7 @@ func (m *TestAllTypesProto2_OneofEnum) SizeVT() (n int) { } var l int _ = l - n += 2 + sov(uint64(m.OneofEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OneofEnum)) return n } func (m *ForeignMessageProto2) SizeVT() (n int) { @@ -7180,7 +7169,7 @@ func (m *ForeignMessageProto2) SizeVT() (n int) { var l int _ = l if m.C != nil { - n += 1 + sov(uint64(*m.C)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.C)) } n += len(m.unknownFields) return n @@ -7193,7 +7182,7 @@ func (m *UnknownToTestAllTypes_OptionalGroup) SizeVT() (n int) { var l int _ = l if m.A != nil { - n += 1 + sov(uint64(*m.A)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.A)) } n += len(m.unknownFields) return n @@ -7206,15 +7195,15 @@ func (m *UnknownToTestAllTypes) SizeVT() (n int) { var l int _ = l if m.OptionalInt32 != nil { - n += 2 + sov(uint64(*m.OptionalInt32)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.OptionalInt32)) } if m.OptionalString != nil { l = len(*m.OptionalString) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.NestedMessage != nil { l = m.NestedMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Optionalgroup != nil { l = m.Optionalgroup.SizeVT() @@ -7225,7 +7214,7 @@ func (m *UnknownToTestAllTypes) SizeVT() (n int) { } if len(m.RepeatedInt32) > 0 { for _, e := range m.RepeatedInt32 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } n += len(m.unknownFields) @@ -7260,18 +7249,12 @@ func (m *OneStringProto2) SizeVT() (n int) { _ = l if m.Data != nil { l = len(*m.Data) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *TestAllTypesProto2_NestedMessage) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7280,7 +7263,7 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7308,7 +7291,7 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7328,7 +7311,7 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7341,11 +7324,11 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7359,12 +7342,12 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7387,7 +7370,7 @@ func (m *TestAllTypesProto2_Data) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7415,7 +7398,7 @@ func (m *TestAllTypesProto2_Data) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7435,7 +7418,7 @@ func (m *TestAllTypesProto2_Data) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7450,12 +7433,12 @@ func (m *TestAllTypesProto2_Data) UnmarshalVT(dAtA []byte) error { m.GroupUint32 = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7478,7 +7461,7 @@ func (m *TestAllTypesProto2_MessageSetCorrect) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7501,12 +7484,12 @@ func (m *TestAllTypesProto2_MessageSetCorrect) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7537,7 +7520,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVT(dAtA []byte var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7565,7 +7548,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVT(dAtA []byte var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7579,11 +7562,11 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVT(dAtA []byte } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7593,12 +7576,12 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVT(dAtA []byte iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7621,7 +7604,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) UnmarshalVT(dAtA []byte var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7649,7 +7632,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) UnmarshalVT(dAtA []byte var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7664,12 +7647,12 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) UnmarshalVT(dAtA []byte m.I = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7692,7 +7675,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7720,7 +7703,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7740,7 +7723,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7760,7 +7743,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7780,7 +7763,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7800,7 +7783,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7821,7 +7804,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7911,7 +7894,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7932,7 +7915,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7946,11 +7929,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7965,7 +7948,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7978,11 +7961,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7999,7 +7982,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8012,11 +7995,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8035,7 +8018,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8048,11 +8031,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8071,7 +8054,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8091,7 +8074,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v ForeignEnumProto2 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8111,7 +8094,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8125,11 +8108,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8144,7 +8127,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8158,11 +8141,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8177,7 +8160,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8190,11 +8173,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8211,7 +8194,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8228,7 +8211,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8241,11 +8224,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8265,7 +8248,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8287,7 +8270,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8304,7 +8287,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8317,11 +8300,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8341,7 +8324,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8363,7 +8346,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8380,7 +8363,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8393,11 +8376,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8417,7 +8400,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8439,7 +8422,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8456,7 +8439,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8469,11 +8452,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8493,7 +8476,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8515,7 +8498,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8533,7 +8516,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8546,11 +8529,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8570,7 +8553,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8593,7 +8576,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8611,7 +8594,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8624,11 +8607,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8648,7 +8631,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8679,7 +8662,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8692,11 +8675,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8731,7 +8714,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8744,11 +8727,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8783,7 +8766,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8796,11 +8779,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8835,7 +8818,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8848,11 +8831,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8888,7 +8871,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8901,11 +8884,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8942,7 +8925,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8955,11 +8938,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8987,7 +8970,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9004,7 +8987,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9017,11 +9000,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9035,7 +9018,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9059,7 +9042,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9073,11 +9056,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9091,7 +9074,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9104,11 +9087,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9123,7 +9106,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9136,11 +9119,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9157,7 +9140,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9170,11 +9153,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9189,7 +9172,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9206,7 +9189,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9219,11 +9202,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9236,7 +9219,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9258,7 +9241,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v ForeignEnumProto2 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9275,7 +9258,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9288,11 +9271,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9305,7 +9288,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v ForeignEnumProto2 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9329,7 +9312,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9343,11 +9326,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9361,7 +9344,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9375,11 +9358,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9393,7 +9376,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9406,11 +9389,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9425,7 +9408,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9441,7 +9424,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9456,7 +9439,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9470,12 +9453,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9492,7 +9475,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9505,11 +9488,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9524,7 +9507,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9540,7 +9523,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9555,7 +9538,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9569,12 +9552,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9591,7 +9574,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9604,11 +9587,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9623,7 +9606,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9639,7 +9622,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9654,7 +9637,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9668,12 +9651,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9690,7 +9673,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9703,11 +9686,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9722,7 +9705,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9738,7 +9721,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9753,7 +9736,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9767,12 +9750,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9789,7 +9772,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9802,11 +9785,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9821,7 +9804,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9838,7 +9821,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapkeytemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9856,7 +9839,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapvaluetemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9872,12 +9855,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { mapvalue = int32(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9894,7 +9877,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9907,11 +9890,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9926,7 +9909,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9943,7 +9926,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapkeytemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9961,7 +9944,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapvaluetemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9977,12 +9960,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { mapvalue = int64(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9999,7 +9982,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10012,11 +9995,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10031,7 +10014,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10058,12 +10041,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10080,7 +10063,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10093,11 +10076,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10112,7 +10095,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10139,12 +10122,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10161,7 +10144,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10174,11 +10157,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10193,7 +10176,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10220,12 +10203,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10242,7 +10225,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10255,11 +10238,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10274,7 +10257,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10301,12 +10284,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10323,7 +10306,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10336,11 +10319,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10355,7 +10338,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10371,7 +10354,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10393,12 +10376,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { mapvalue = math.Float32frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10415,7 +10398,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10428,11 +10411,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10447,7 +10430,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10463,7 +10446,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10485,12 +10468,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { mapvalue = math.Float64frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10507,7 +10490,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10520,11 +10503,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10539,7 +10522,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10556,7 +10539,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapkeytemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10573,7 +10556,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapvaluetemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10588,12 +10571,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { mapvalue = bool(mapvaluetemp != 0) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10610,7 +10593,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10623,11 +10606,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10642,7 +10625,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10659,7 +10642,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10673,11 +10656,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -10688,7 +10671,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10702,11 +10685,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -10715,12 +10698,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10737,7 +10720,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10750,11 +10733,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10769,7 +10752,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10786,7 +10769,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10800,11 +10783,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -10815,7 +10798,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10829,11 +10812,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postbytesIndex > l { return io.ErrUnexpectedEOF @@ -10843,12 +10826,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx = postbytesIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10865,7 +10848,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10878,11 +10861,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10897,7 +10880,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10914,7 +10897,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10928,11 +10911,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -10943,7 +10926,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10956,11 +10939,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -10972,12 +10955,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10994,7 +10977,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11007,11 +10990,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11026,7 +11009,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11043,7 +11026,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11057,11 +11040,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -11072,7 +11055,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11085,11 +11068,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -11101,12 +11084,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -11123,7 +11106,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11136,11 +11119,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11155,7 +11138,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11172,7 +11155,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11186,11 +11169,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -11200,7 +11183,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11214,12 +11197,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -11236,7 +11219,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11249,11 +11232,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11268,7 +11251,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11285,7 +11268,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11299,11 +11282,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -11313,7 +11296,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11327,12 +11310,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -11347,7 +11330,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11364,7 +11347,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11377,11 +11360,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11401,7 +11384,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11423,7 +11406,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11440,7 +11423,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11453,11 +11436,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11477,7 +11460,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11499,7 +11482,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11516,7 +11499,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11529,11 +11512,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11553,7 +11536,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11575,7 +11558,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11592,7 +11575,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11605,11 +11588,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11629,7 +11612,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11651,7 +11634,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11669,7 +11652,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11682,11 +11665,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11706,7 +11689,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11729,7 +11712,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11747,7 +11730,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11760,11 +11743,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11784,7 +11767,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11815,7 +11798,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11828,11 +11811,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11867,7 +11850,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11880,11 +11863,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11919,7 +11902,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11932,11 +11915,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11971,7 +11954,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11984,11 +11967,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12024,7 +12007,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12037,11 +12020,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12078,7 +12061,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12091,11 +12074,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12123,7 +12106,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12140,7 +12123,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12153,11 +12136,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12171,7 +12154,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12193,7 +12176,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12210,7 +12193,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12223,11 +12206,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12240,7 +12223,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12262,7 +12245,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12279,7 +12262,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12292,11 +12275,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12316,7 +12299,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12338,7 +12321,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12355,7 +12338,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12368,11 +12351,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12392,7 +12375,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12414,7 +12397,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12431,7 +12414,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12444,11 +12427,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12468,7 +12451,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12490,7 +12473,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12507,7 +12490,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12520,11 +12503,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12544,7 +12527,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12566,7 +12549,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12584,7 +12567,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12597,11 +12580,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12621,7 +12604,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12644,7 +12627,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12662,7 +12645,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12675,11 +12658,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12699,7 +12682,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12730,7 +12713,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12743,11 +12726,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12782,7 +12765,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12795,11 +12778,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12834,7 +12817,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12847,11 +12830,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12886,7 +12869,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12899,11 +12882,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12939,7 +12922,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12952,11 +12935,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12993,7 +12976,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13006,11 +12989,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13038,7 +13021,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13055,7 +13038,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13068,11 +13051,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13086,7 +13069,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13108,7 +13091,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13125,7 +13108,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13138,11 +13121,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13155,7 +13138,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13179,7 +13162,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13199,7 +13182,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13212,11 +13195,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13240,7 +13223,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13254,11 +13237,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13272,7 +13255,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13285,11 +13268,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13305,7 +13288,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13326,7 +13309,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13368,7 +13351,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13391,7 +13374,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var groupFieldWire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13410,12 +13393,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } break } - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } iNdEx += skippy } @@ -13426,7 +13409,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13446,7 +13429,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13466,7 +13449,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13486,7 +13469,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13506,7 +13489,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13527,7 +13510,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13617,7 +13600,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13638,7 +13621,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13652,11 +13635,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13671,7 +13654,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13684,11 +13667,11 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13705,7 +13688,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13725,7 +13708,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13745,7 +13728,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13765,7 +13748,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13785,7 +13768,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13805,7 +13788,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13825,7 +13808,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13845,7 +13828,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13865,7 +13848,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13885,7 +13868,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13905,7 +13888,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13925,7 +13908,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13945,7 +13928,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13965,7 +13948,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13985,7 +13968,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14005,7 +13988,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14025,7 +14008,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14045,7 +14028,7 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14060,12 +14043,12 @@ func (m *TestAllTypesProto2) UnmarshalVT(dAtA []byte) error { m.FieldName18__ = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14096,7 +14079,7 @@ func (m *ForeignMessageProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14124,7 +14107,7 @@ func (m *ForeignMessageProto2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14139,12 +14122,12 @@ func (m *ForeignMessageProto2) UnmarshalVT(dAtA []byte) error { m.C = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14167,7 +14150,7 @@ func (m *UnknownToTestAllTypes_OptionalGroup) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14195,7 +14178,7 @@ func (m *UnknownToTestAllTypes_OptionalGroup) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14210,12 +14193,12 @@ func (m *UnknownToTestAllTypes_OptionalGroup) UnmarshalVT(dAtA []byte) error { m.A = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14238,7 +14221,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14266,7 +14249,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14286,7 +14269,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14300,11 +14283,11 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14319,7 +14302,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14332,11 +14315,11 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14358,7 +14341,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var groupFieldWire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14377,12 +14360,12 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { } break } - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } iNdEx += skippy } @@ -14393,7 +14376,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14412,7 +14395,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14429,7 +14412,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14442,11 +14425,11 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14466,7 +14449,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14485,12 +14468,12 @@ func (m *UnknownToTestAllTypes) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14513,7 +14496,7 @@ func (m *NullHypothesisProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14536,12 +14519,12 @@ func (m *NullHypothesisProto2) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14564,7 +14547,7 @@ func (m *EnumOnlyProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14587,12 +14570,12 @@ func (m *EnumOnlyProto2) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14615,7 +14598,7 @@ func (m *OneStringProto2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14643,7 +14626,7 @@ func (m *OneStringProto2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14657,11 +14640,11 @@ func (m *OneStringProto2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14671,12 +14654,12 @@ func (m *OneStringProto2) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14691,92 +14674,6 @@ func (m *OneStringProto2) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *TestAllTypesProto2_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -14785,7 +14682,7 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14813,7 +14710,7 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14833,7 +14730,7 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14846,11 +14743,11 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14864,12 +14761,12 @@ func (m *TestAllTypesProto2_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14892,7 +14789,7 @@ func (m *TestAllTypesProto2_Data) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14920,7 +14817,7 @@ func (m *TestAllTypesProto2_Data) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14940,7 +14837,7 @@ func (m *TestAllTypesProto2_Data) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14955,12 +14852,12 @@ func (m *TestAllTypesProto2_Data) UnmarshalVTUnsafe(dAtA []byte) error { m.GroupUint32 = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14983,7 +14880,7 @@ func (m *TestAllTypesProto2_MessageSetCorrect) UnmarshalVTUnsafe(dAtA []byte) er var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15006,12 +14903,12 @@ func (m *TestAllTypesProto2_MessageSetCorrect) UnmarshalVTUnsafe(dAtA []byte) er switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15042,7 +14939,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVTUnsafe(dAtA var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15070,7 +14967,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVTUnsafe(dAtA var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15084,11 +14981,11 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVTUnsafe(dAtA } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15098,12 +14995,12 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVTUnsafe(dAtA iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15126,7 +15023,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) UnmarshalVTUnsafe(dAtA var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15154,7 +15051,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) UnmarshalVTUnsafe(dAtA var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15169,12 +15066,12 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension2) UnmarshalVTUnsafe(dAtA m.I = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15197,7 +15094,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15225,7 +15122,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15245,7 +15142,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15265,7 +15162,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15285,7 +15182,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15305,7 +15202,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15326,7 +15223,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15416,7 +15313,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15437,7 +15334,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15451,11 +15348,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15470,7 +15367,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15483,11 +15380,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15501,7 +15398,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15514,11 +15411,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15537,7 +15434,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15550,11 +15447,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15573,7 +15470,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15593,7 +15490,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v ForeignEnumProto2 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15613,7 +15510,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15627,11 +15524,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15646,7 +15543,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15660,11 +15557,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15679,7 +15576,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15692,11 +15589,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15713,7 +15610,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15730,7 +15627,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15743,11 +15640,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15767,7 +15664,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15789,7 +15686,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15806,7 +15703,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15819,11 +15716,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15843,7 +15740,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15865,7 +15762,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15882,7 +15779,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15895,11 +15792,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15919,7 +15816,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15941,7 +15838,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15958,7 +15855,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15971,11 +15868,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15995,7 +15892,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16017,7 +15914,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16035,7 +15932,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16048,11 +15945,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16072,7 +15969,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16095,7 +15992,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16113,7 +16010,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16126,11 +16023,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16150,7 +16047,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16181,7 +16078,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16194,11 +16091,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16233,7 +16130,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16246,11 +16143,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16285,7 +16182,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16298,11 +16195,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16337,7 +16234,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16350,11 +16247,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16390,7 +16287,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16403,11 +16300,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16444,7 +16341,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16457,11 +16354,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16489,7 +16386,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16506,7 +16403,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16519,11 +16416,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16537,7 +16434,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16561,7 +16458,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16575,11 +16472,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16593,7 +16490,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16606,11 +16503,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16624,7 +16521,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16637,11 +16534,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16658,7 +16555,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16671,11 +16568,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16690,7 +16587,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16707,7 +16604,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16720,11 +16617,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16737,7 +16634,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16759,7 +16656,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v ForeignEnumProto2 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16776,7 +16673,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16789,11 +16686,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16806,7 +16703,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v ForeignEnumProto2 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16830,7 +16727,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16844,11 +16741,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16862,7 +16759,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16876,11 +16773,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16894,7 +16791,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16907,11 +16804,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16926,7 +16823,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16942,7 +16839,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16957,7 +16854,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16971,12 +16868,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -16993,7 +16890,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17006,11 +16903,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17025,7 +16922,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17041,7 +16938,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17056,7 +16953,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17070,12 +16967,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17092,7 +16989,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17105,11 +17002,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17124,7 +17021,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17140,7 +17037,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17155,7 +17052,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17169,12 +17066,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17191,7 +17088,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17204,11 +17101,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17223,7 +17120,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17239,7 +17136,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17254,7 +17151,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17268,12 +17165,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17290,7 +17187,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17303,11 +17200,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17322,7 +17219,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17339,7 +17236,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapkeytemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17357,7 +17254,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapvaluetemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17373,12 +17270,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = int32(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17395,7 +17292,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17408,11 +17305,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17427,7 +17324,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17444,7 +17341,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapkeytemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17462,7 +17359,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapvaluetemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17478,12 +17375,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = int64(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17500,7 +17397,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17513,11 +17410,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17532,7 +17429,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17559,12 +17456,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17581,7 +17478,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17594,11 +17491,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17613,7 +17510,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17640,12 +17537,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17662,7 +17559,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17675,11 +17572,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17694,7 +17591,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17721,12 +17618,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17743,7 +17640,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17756,11 +17653,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17775,7 +17672,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17802,12 +17699,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17824,7 +17721,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17837,11 +17734,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17856,7 +17753,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17872,7 +17769,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17894,12 +17791,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = math.Float32frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17916,7 +17813,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17929,11 +17826,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17948,7 +17845,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17964,7 +17861,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17986,12 +17883,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = math.Float64frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18008,7 +17905,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18021,11 +17918,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18040,7 +17937,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18057,7 +17954,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapkeytemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18074,7 +17971,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapvaluetemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18089,12 +17986,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = bool(mapvaluetemp != 0) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18111,7 +18008,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18124,11 +18021,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18143,7 +18040,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18160,7 +18057,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18174,11 +18071,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18189,7 +18086,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18203,11 +18100,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -18216,12 +18113,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18238,7 +18135,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18251,11 +18148,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18270,7 +18167,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18287,7 +18184,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18301,11 +18198,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18316,7 +18213,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18330,11 +18227,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postbytesIndex > l { return io.ErrUnexpectedEOF @@ -18343,12 +18240,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postbytesIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18365,7 +18262,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18378,11 +18275,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18397,7 +18294,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18414,7 +18311,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18428,11 +18325,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18443,7 +18340,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18456,11 +18353,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -18472,12 +18369,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18494,7 +18391,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18507,11 +18404,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18526,7 +18423,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18543,7 +18440,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18557,11 +18454,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18572,7 +18469,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18585,11 +18482,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -18601,12 +18498,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18623,7 +18520,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18636,11 +18533,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18655,7 +18552,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18672,7 +18569,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18686,11 +18583,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18700,7 +18597,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18714,12 +18611,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18736,7 +18633,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18749,11 +18646,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18768,7 +18665,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18785,7 +18682,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18799,11 +18696,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18813,7 +18710,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18827,12 +18724,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18847,7 +18744,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18864,7 +18761,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18877,11 +18774,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18901,7 +18798,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18923,7 +18820,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18940,7 +18837,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18953,11 +18850,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18977,7 +18874,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18999,7 +18896,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19016,7 +18913,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19029,11 +18926,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19053,7 +18950,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19075,7 +18972,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19092,7 +18989,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19105,11 +19002,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19129,7 +19026,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19151,7 +19048,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19169,7 +19066,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19182,11 +19079,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19206,7 +19103,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19229,7 +19126,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19247,7 +19144,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19260,11 +19157,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19284,7 +19181,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19315,7 +19212,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19328,11 +19225,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19367,7 +19264,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19380,11 +19277,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19419,7 +19316,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19432,11 +19329,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19471,7 +19368,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19484,11 +19381,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19524,7 +19421,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19537,11 +19434,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19578,7 +19475,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19591,11 +19488,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19623,7 +19520,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19640,7 +19537,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19653,11 +19550,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19671,7 +19568,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19693,7 +19590,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19710,7 +19607,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19723,11 +19620,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19740,7 +19637,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19762,7 +19659,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19779,7 +19676,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19792,11 +19689,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19816,7 +19713,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19838,7 +19735,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19855,7 +19752,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19868,11 +19765,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19892,7 +19789,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19914,7 +19811,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19931,7 +19828,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19944,11 +19841,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19968,7 +19865,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19990,7 +19887,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20007,7 +19904,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20020,11 +19917,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20044,7 +19941,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20066,7 +19963,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20084,7 +19981,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20097,11 +19994,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20121,7 +20018,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20144,7 +20041,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20162,7 +20059,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20175,11 +20072,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20199,7 +20096,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20230,7 +20127,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20243,11 +20140,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20282,7 +20179,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20295,11 +20192,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20334,7 +20231,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20347,11 +20244,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20386,7 +20283,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20399,11 +20296,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20439,7 +20336,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20452,11 +20349,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20493,7 +20390,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20506,11 +20403,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20538,7 +20435,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20555,7 +20452,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20568,11 +20465,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20586,7 +20483,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20608,7 +20505,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20625,7 +20522,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20638,11 +20535,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20655,7 +20552,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20679,7 +20576,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20699,7 +20596,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20712,11 +20609,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20740,7 +20637,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20754,11 +20651,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20772,7 +20669,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20785,11 +20682,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20804,7 +20701,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20825,7 +20722,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20867,7 +20764,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto2_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20890,7 +20787,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var groupFieldWire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20909,12 +20806,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } break } - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } iNdEx += skippy } @@ -20925,7 +20822,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20945,7 +20842,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20965,7 +20862,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20985,7 +20882,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21005,7 +20902,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21026,7 +20923,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21116,7 +21013,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21137,7 +21034,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21151,11 +21048,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21170,7 +21067,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21183,11 +21080,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21201,7 +21098,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21221,7 +21118,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21241,7 +21138,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21261,7 +21158,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21281,7 +21178,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21301,7 +21198,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21321,7 +21218,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21341,7 +21238,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21361,7 +21258,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21381,7 +21278,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21401,7 +21298,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21421,7 +21318,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21441,7 +21338,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21461,7 +21358,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21481,7 +21378,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21501,7 +21398,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21521,7 +21418,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21541,7 +21438,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21556,12 +21453,12 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { m.FieldName18__ = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -21592,7 +21489,7 @@ func (m *ForeignMessageProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21620,7 +21517,7 @@ func (m *ForeignMessageProto2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21635,12 +21532,12 @@ func (m *ForeignMessageProto2) UnmarshalVTUnsafe(dAtA []byte) error { m.C = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -21663,7 +21560,7 @@ func (m *UnknownToTestAllTypes_OptionalGroup) UnmarshalVTUnsafe(dAtA []byte) err var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21691,7 +21588,7 @@ func (m *UnknownToTestAllTypes_OptionalGroup) UnmarshalVTUnsafe(dAtA []byte) err var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21706,12 +21603,12 @@ func (m *UnknownToTestAllTypes_OptionalGroup) UnmarshalVTUnsafe(dAtA []byte) err m.A = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -21734,7 +21631,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21762,7 +21659,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21782,7 +21679,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21796,11 +21693,11 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21815,7 +21712,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21828,11 +21725,11 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21854,7 +21751,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var groupFieldWire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21873,12 +21770,12 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { } break } - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } iNdEx += skippy } @@ -21889,7 +21786,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21908,7 +21805,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21925,7 +21822,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21938,11 +21835,11 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21962,7 +21859,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21981,12 +21878,12 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -22009,7 +21906,7 @@ func (m *NullHypothesisProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22032,12 +21929,12 @@ func (m *NullHypothesisProto2) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -22060,7 +21957,7 @@ func (m *EnumOnlyProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22083,12 +21980,12 @@ func (m *EnumOnlyProto2) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -22111,7 +22008,7 @@ func (m *OneStringProto2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22139,7 +22036,7 @@ func (m *OneStringProto2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22153,11 +22050,11 @@ func (m *OneStringProto2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -22167,12 +22064,12 @@ func (m *OneStringProto2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go index 8dfdc51..5618fb5 100644 --- a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go @@ -7,6 +7,7 @@ package conformance import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" durationpb1 "github.com/planetscale/vtprotobuf/types/known/durationpb" fieldmaskpb1 "github.com/planetscale/vtprotobuf/types/known/fieldmaskpb" @@ -2235,12 +2236,12 @@ func (m *TestAllTypesProto3_NestedMessage) MarshalToSizedBufferVT(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if m.A != 0 { - i = encodeVarint(dAtA, i, uint64(m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.A)) i-- dAtA[i] = 0x8 } @@ -2287,126 +2288,126 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= size } if m.FieldName18__ != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName18__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName18__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x90 } if m.FieldName17__ != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName17__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName17__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x88 } if m.Field__Name16 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field__Name16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field__Name16)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x80 } if m.Field_Name15 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name15)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name15)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf8 } if m.X_FieldName14 != 0 { - i = encodeVarint(dAtA, i, uint64(m.X_FieldName14)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.X_FieldName14)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf0 } if m.XFieldName13 != 0 { - i = encodeVarint(dAtA, i, uint64(m.XFieldName13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.XFieldName13)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe8 } if m.FIELDName12 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FIELDName12)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FIELDName12)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe0 } if m.FIELD_NAME11 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FIELD_NAME11)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FIELD_NAME11)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd8 } if m.Field_Name10 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name10)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd0 } if m.Field_Name9 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name9)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name9)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc8 } if m.FieldName8 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName8)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc0 } if m.FieldName7 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName7)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName7)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb8 } if m.Field_0Name6 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_0Name6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_0Name6)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb0 } if m.Field0Name5 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field0Name5)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field0Name5)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa8 } if m.Field_Name4_ != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name4_)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name4_)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa0 } if m.XFieldName3 != 0 { - i = encodeVarint(dAtA, i, uint64(m.XFieldName3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.XFieldName3)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x98 } if m.FieldName2 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName2)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x90 } if m.Fieldname1 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Fieldname1)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Fieldname1)) i-- dAtA[i] = 0x19 i-- @@ -2419,7 +2420,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x14 i-- @@ -2433,7 +2434,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2447,7 +2448,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2461,7 +2462,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2475,7 +2476,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2489,7 +2490,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2503,7 +2504,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2511,7 +2512,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } } if m.OptionalNullValue != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalNullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalNullValue)) i-- dAtA[i] = 0x13 i-- @@ -2523,7 +2524,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2535,7 +2536,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2547,7 +2548,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2559,7 +2560,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i-- @@ -2571,7 +2572,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i-- @@ -2583,7 +2584,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i-- @@ -2596,7 +2597,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2610,7 +2611,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2624,7 +2625,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2638,7 +2639,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2652,7 +2653,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2666,7 +2667,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2680,7 +2681,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2694,7 +2695,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2708,7 +2709,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2721,7 +2722,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2733,7 +2734,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -2745,7 +2746,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -2757,7 +2758,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -2769,7 +2770,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -2781,7 +2782,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -2793,7 +2794,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -2805,7 +2806,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -2817,7 +2818,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -2825,7 +2826,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedNestedEnum) > 0 { for iNdEx := len(m.UnpackedNestedEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) i-- dAtA[i] = 0x6 i-- @@ -2911,7 +2912,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.UnpackedSint64) > 0 { for iNdEx := len(m.UnpackedSint64) - 1; iNdEx >= 0; iNdEx-- { x3 := (uint64(m.UnpackedSint64[iNdEx]) << 1) ^ uint64((m.UnpackedSint64[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x3)) i-- dAtA[i] = 0x5 i-- @@ -2921,7 +2922,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.UnpackedSint32) > 0 { for iNdEx := len(m.UnpackedSint32) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint32(m.UnpackedSint32[iNdEx]) << 1) ^ uint32((m.UnpackedSint32[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x5 i-- @@ -2930,7 +2931,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedUint64) > 0 { for iNdEx := len(m.UnpackedUint64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2939,7 +2940,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedUint32) > 0 { for iNdEx := len(m.UnpackedUint32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2948,7 +2949,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedInt64) > 0 { for iNdEx := len(m.UnpackedInt64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2957,7 +2958,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } if len(m.UnpackedInt32) > 0 { for iNdEx := len(m.UnpackedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -2967,7 +2968,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedNestedEnum) > 0 { var pksize6 int for _, num := range m.PackedNestedEnum { - pksize6 += sov(uint64(num)) + pksize6 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize6 j5 := i @@ -2981,7 +2982,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j5] = uint8(num) j5++ } - i = encodeVarint(dAtA, i, uint64(pksize6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize6)) i-- dAtA[i] = 0x5 i-- @@ -2996,7 +2997,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.PackedBool))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedBool))) i-- dAtA[i] = 0x5 i-- @@ -3008,7 +3009,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f7)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) i-- dAtA[i] = 0x5 i-- @@ -3020,7 +3021,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f8)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) i-- dAtA[i] = 0x5 i-- @@ -3031,7 +3032,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedSfixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -3042,7 +3043,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedSfixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -3053,7 +3054,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedFixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -3064,7 +3065,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedFixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -3073,7 +3074,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedSint64) > 0 { var pksize10 int for _, num := range m.PackedSint64 { - pksize10 += soz(uint64(num)) + pksize10 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize10 j9 := i @@ -3087,7 +3088,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j9] = uint8(x11) j9++ } - i = encodeVarint(dAtA, i, uint64(pksize10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize10)) i-- dAtA[i] = 0x5 i-- @@ -3096,7 +3097,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedSint32) > 0 { var pksize13 int for _, num := range m.PackedSint32 { - pksize13 += soz(uint64(num)) + pksize13 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize13 j12 := i @@ -3110,7 +3111,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j12] = uint8(x14) j12++ } - i = encodeVarint(dAtA, i, uint64(pksize13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize13)) i-- dAtA[i] = 0x4 i-- @@ -3119,7 +3120,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedUint64) > 0 { var pksize16 int for _, num := range m.PackedUint64 { - pksize16 += sov(uint64(num)) + pksize16 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize16 j15 := i @@ -3132,7 +3133,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j15] = uint8(num) j15++ } - i = encodeVarint(dAtA, i, uint64(pksize16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize16)) i-- dAtA[i] = 0x4 i-- @@ -3141,7 +3142,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedUint32) > 0 { var pksize18 int for _, num := range m.PackedUint32 { - pksize18 += sov(uint64(num)) + pksize18 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize18 j17 := i @@ -3154,7 +3155,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j17] = uint8(num) j17++ } - i = encodeVarint(dAtA, i, uint64(pksize18)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize18)) i-- dAtA[i] = 0x4 i-- @@ -3163,7 +3164,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedInt64) > 0 { var pksize20 int for _, num := range m.PackedInt64 { - pksize20 += sov(uint64(num)) + pksize20 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize20 j19 := i @@ -3177,7 +3178,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j19] = uint8(num) j19++ } - i = encodeVarint(dAtA, i, uint64(pksize20)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize20)) i-- dAtA[i] = 0x4 i-- @@ -3186,7 +3187,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedInt32) > 0 { var pksize22 int for _, num := range m.PackedInt32 { - pksize22 += sov(uint64(num)) + pksize22 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize22 j21 := i @@ -3200,7 +3201,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j21] = uint8(num) j21++ } - i = encodeVarint(dAtA, i, uint64(pksize22)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize22)) i-- dAtA[i] = 0x4 i-- @@ -3210,15 +3211,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapStringForeignEnum { v := m.MapStringForeignEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3229,15 +3230,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapStringNestedEnum { v := m.MapStringNestedEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3253,15 +3254,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3277,15 +3278,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3298,15 +3299,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3319,15 +3320,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3354,7 +3355,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3369,10 +3370,10 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(v)))) i-- dAtA[i] = 0x11 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3387,10 +3388,10 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(v)))) i-- dAtA[i] = 0x15 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3409,7 +3410,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3428,7 +3429,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -3447,7 +3448,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3466,7 +3467,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3477,13 +3478,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapSint64Sint64 { v := m.MapSint64Sint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3494,13 +3495,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapSint32Sint32 { v := m.MapSint32Sint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3511,13 +3512,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapUint64Uint64 { v := m.MapUint64Uint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3528,13 +3529,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapUint32Uint32 { v := m.MapUint32Uint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3545,13 +3546,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapInt64Int64 { v := m.MapInt64Int64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3562,13 +3563,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.MapInt32Int32 { v := m.MapInt32Int32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -3579,7 +3580,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedCord) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedCord[iNdEx]) copy(dAtA[i:], m.RepeatedCord[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -3590,7 +3591,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedStringPiece) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedStringPiece[iNdEx]) copy(dAtA[i:], m.RepeatedStringPiece[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -3600,7 +3601,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedForeignEnum) > 0 { var pksize24 int for _, num := range m.RepeatedForeignEnum { - pksize24 += sov(uint64(num)) + pksize24 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize24 j23 := i @@ -3614,7 +3615,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j23] = uint8(num) j23++ } - i = encodeVarint(dAtA, i, uint64(pksize24)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize24)) i-- dAtA[i] = 0x3 i-- @@ -3623,7 +3624,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedNestedEnum) > 0 { var pksize26 int for _, num := range m.RepeatedNestedEnum { - pksize26 += sov(uint64(num)) + pksize26 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize26 j25 := i @@ -3637,7 +3638,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j25] = uint8(num) j25++ } - i = encodeVarint(dAtA, i, uint64(pksize26)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize26)) i-- dAtA[i] = 0x3 i-- @@ -3650,7 +3651,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -3664,7 +3665,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -3675,7 +3676,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedBytes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedBytes[iNdEx]) copy(dAtA[i:], m.RepeatedBytes[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -3686,7 +3687,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedString) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedString[iNdEx]) copy(dAtA[i:], m.RepeatedString[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -3702,7 +3703,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedBool))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedBool))) i-- dAtA[i] = 0x2 i-- @@ -3714,7 +3715,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f27)) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedDouble)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedDouble)*8)) i-- dAtA[i] = 0x2 i-- @@ -3726,7 +3727,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f28)) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedFloat)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedFloat)*4)) i-- dAtA[i] = 0x2 i-- @@ -3737,7 +3738,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.RepeatedSfixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed64)*8)) i-- dAtA[i] = 0x2 i-- @@ -3748,7 +3749,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.RepeatedSfixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed32)*4)) i-- dAtA[i] = 0x2 i-- @@ -3759,7 +3760,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.RepeatedFixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedFixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedFixed64)*8)) i-- dAtA[i] = 0x2 i-- @@ -3770,7 +3771,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.RepeatedFixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedFixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedFixed32)*4)) i-- dAtA[i] = 0x2 i-- @@ -3779,7 +3780,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedSint64) > 0 { var pksize30 int for _, num := range m.RepeatedSint64 { - pksize30 += soz(uint64(num)) + pksize30 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize30 j29 := i @@ -3793,7 +3794,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j29] = uint8(x31) j29++ } - i = encodeVarint(dAtA, i, uint64(pksize30)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize30)) i-- dAtA[i] = 0x2 i-- @@ -3802,7 +3803,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedSint32) > 0 { var pksize33 int for _, num := range m.RepeatedSint32 { - pksize33 += soz(uint64(num)) + pksize33 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize33 j32 := i @@ -3816,7 +3817,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j32] = uint8(x34) j32++ } - i = encodeVarint(dAtA, i, uint64(pksize33)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize33)) i-- dAtA[i] = 0x2 i-- @@ -3825,7 +3826,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedUint64) > 0 { var pksize36 int for _, num := range m.RepeatedUint64 { - pksize36 += sov(uint64(num)) + pksize36 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize36 j35 := i @@ -3838,7 +3839,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j35] = uint8(num) j35++ } - i = encodeVarint(dAtA, i, uint64(pksize36)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize36)) i-- dAtA[i] = 0x2 i-- @@ -3847,7 +3848,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedUint32) > 0 { var pksize38 int for _, num := range m.RepeatedUint32 { - pksize38 += sov(uint64(num)) + pksize38 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize38 j37 := i @@ -3860,7 +3861,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j37] = uint8(num) j37++ } - i = encodeVarint(dAtA, i, uint64(pksize38)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize38)) i-- dAtA[i] = 0x2 i-- @@ -3869,7 +3870,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedInt64) > 0 { var pksize40 int for _, num := range m.RepeatedInt64 { - pksize40 += sov(uint64(num)) + pksize40 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize40 j39 := i @@ -3883,7 +3884,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j39] = uint8(num) j39++ } - i = encodeVarint(dAtA, i, uint64(pksize40)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize40)) i-- dAtA[i] = 0x2 i-- @@ -3892,7 +3893,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RepeatedInt32) > 0 { var pksize42 int for _, num := range m.RepeatedInt32 { - pksize42 += sov(uint64(num)) + pksize42 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize42 j41 := i @@ -3906,7 +3907,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j41] = uint8(num) j41++ } - i = encodeVarint(dAtA, i, uint64(pksize42)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize42)) i-- dAtA[i] = 0x1 i-- @@ -3918,7 +3919,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -3927,7 +3928,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.OptionalCord) > 0 { i -= len(m.OptionalCord) copy(dAtA[i:], m.OptionalCord) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalCord))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalCord))) i-- dAtA[i] = 0x1 i-- @@ -3936,28 +3937,28 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.OptionalStringPiece) > 0 { i -= len(m.OptionalStringPiece) copy(dAtA[i:], m.OptionalStringPiece) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalStringPiece))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalStringPiece))) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xc2 } if m.OptionalAliasedEnum != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalAliasedEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalAliasedEnum)) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xb8 } if m.OptionalForeignEnum != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalForeignEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalForeignEnum)) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xb0 } if m.OptionalNestedEnum != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalNestedEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalNestedEnum)) i-- dAtA[i] = 0x1 i-- @@ -3969,7 +3970,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -3981,7 +3982,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -3990,14 +3991,14 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.OptionalBytes) > 0 { i -= len(m.OptionalBytes) copy(dAtA[i:], m.OptionalBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) i-- dAtA[i] = 0x7a } if len(m.OptionalString) > 0 { i -= len(m.OptionalString) copy(dAtA[i:], m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalString))) i-- dAtA[i] = 0x72 } @@ -4048,32 +4049,32 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x3d } if m.OptionalSint64 != 0 { - i = encodeVarint(dAtA, i, uint64((uint64(m.OptionalSint64)<<1)^uint64((m.OptionalSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(m.OptionalSint64)<<1)^uint64((m.OptionalSint64>>63)))) i-- dAtA[i] = 0x30 } if m.OptionalSint32 != 0 { - i = encodeVarint(dAtA, i, uint64((uint32(m.OptionalSint32)<<1)^uint32((m.OptionalSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(m.OptionalSint32)<<1)^uint32((m.OptionalSint32>>31)))) i-- dAtA[i] = 0x28 } if m.OptionalUint64 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalUint64)) i-- dAtA[i] = 0x20 } if m.OptionalUint32 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalUint32)) i-- dAtA[i] = 0x18 } if m.OptionalInt64 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalInt64)) i-- dAtA[i] = 0x10 } if m.OptionalInt32 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalInt32)) i-- dAtA[i] = 0x8 } @@ -4087,7 +4088,7 @@ func (m *TestAllTypesProto3_OneofUint32) MarshalToVT(dAtA []byte) (int, error) { func (m *TestAllTypesProto3_OneofUint32) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint32)) i-- dAtA[i] = 0x6 i-- @@ -4107,7 +4108,7 @@ func (m *TestAllTypesProto3_OneofNestedMessage) MarshalToSizedBufferVT(dAtA []by return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -4124,7 +4125,7 @@ func (m *TestAllTypesProto3_OneofString) MarshalToSizedBufferVT(dAtA []byte) (in i := len(dAtA) i -= len(m.OneofString) copy(dAtA[i:], m.OneofString) - i = encodeVarint(dAtA, i, uint64(len(m.OneofString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofString))) i-- dAtA[i] = 0x7 i-- @@ -4140,7 +4141,7 @@ func (m *TestAllTypesProto3_OneofBytes) MarshalToSizedBufferVT(dAtA []byte) (int i := len(dAtA) i -= len(m.OneofBytes) copy(dAtA[i:], m.OneofBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OneofBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofBytes))) i-- dAtA[i] = 0x7 i-- @@ -4173,7 +4174,7 @@ func (m *TestAllTypesProto3_OneofUint64) MarshalToVT(dAtA []byte) (int, error) { func (m *TestAllTypesProto3_OneofUint64) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint64)) i-- dAtA[i] = 0x7 i-- @@ -4217,7 +4218,7 @@ func (m *TestAllTypesProto3_OneofEnum) MarshalToVT(dAtA []byte) (int, error) { func (m *TestAllTypesProto3_OneofEnum) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofEnum)) i-- dAtA[i] = 0x7 i-- @@ -4231,7 +4232,7 @@ func (m *TestAllTypesProto3_OneofNullValue) MarshalToVT(dAtA []byte) (int, error func (m *TestAllTypesProto3_OneofNullValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofNullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofNullValue)) i-- dAtA[i] = 0x7 i-- @@ -4269,7 +4270,7 @@ func (m *ForeignMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.C != 0 { - i = encodeVarint(dAtA, i, uint64(m.C)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.C)) i-- dAtA[i] = 0x8 } @@ -4378,12 +4379,12 @@ func (m *TestAllTypesProto3_NestedMessage) MarshalToSizedBufferVTStrict(dAtA []b return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if m.A != 0 { - i = encodeVarint(dAtA, i, uint64(m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.A)) i-- dAtA[i] = 0x8 } @@ -4421,126 +4422,126 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err copy(dAtA[i:], m.unknownFields) } if m.FieldName18__ != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName18__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName18__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x90 } if m.FieldName17__ != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName17__)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName17__)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x88 } if m.Field__Name16 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field__Name16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field__Name16)) i-- dAtA[i] = 0x1a i-- dAtA[i] = 0x80 } if m.Field_Name15 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name15)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name15)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf8 } if m.X_FieldName14 != 0 { - i = encodeVarint(dAtA, i, uint64(m.X_FieldName14)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.X_FieldName14)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xf0 } if m.XFieldName13 != 0 { - i = encodeVarint(dAtA, i, uint64(m.XFieldName13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.XFieldName13)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe8 } if m.FIELDName12 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FIELDName12)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FIELDName12)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xe0 } if m.FIELD_NAME11 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FIELD_NAME11)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FIELD_NAME11)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd8 } if m.Field_Name10 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name10)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xd0 } if m.Field_Name9 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name9)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name9)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc8 } if m.FieldName8 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName8)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xc0 } if m.FieldName7 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName7)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName7)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb8 } if m.Field_0Name6 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_0Name6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_0Name6)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xb0 } if m.Field0Name5 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field0Name5)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field0Name5)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa8 } if m.Field_Name4_ != 0 { - i = encodeVarint(dAtA, i, uint64(m.Field_Name4_)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Field_Name4_)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0xa0 } if m.XFieldName3 != 0 { - i = encodeVarint(dAtA, i, uint64(m.XFieldName3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.XFieldName3)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x98 } if m.FieldName2 != 0 { - i = encodeVarint(dAtA, i, uint64(m.FieldName2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FieldName2)) i-- dAtA[i] = 0x19 i-- dAtA[i] = 0x90 } if m.Fieldname1 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Fieldname1)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Fieldname1)) i-- dAtA[i] = 0x19 i-- @@ -4553,7 +4554,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x14 i-- @@ -4567,7 +4568,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4581,7 +4582,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4595,7 +4596,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4609,7 +4610,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4623,7 +4624,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4637,7 +4638,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4645,7 +4646,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } } if m.OptionalNullValue != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalNullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalNullValue)) i-- dAtA[i] = 0x13 i-- @@ -4657,7 +4658,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4669,7 +4670,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4681,7 +4682,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4693,7 +4694,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i-- @@ -4705,7 +4706,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i-- @@ -4717,7 +4718,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i-- @@ -4730,7 +4731,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4744,7 +4745,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4758,7 +4759,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4772,7 +4773,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4786,7 +4787,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4800,7 +4801,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4814,7 +4815,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4828,7 +4829,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4842,7 +4843,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4855,7 +4856,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4867,7 +4868,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xd i-- @@ -4879,7 +4880,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -4891,7 +4892,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -4903,7 +4904,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -4915,7 +4916,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -4927,7 +4928,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -4939,7 +4940,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -4951,7 +4952,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xc i-- @@ -5029,7 +5030,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedNestedEnum) > 0 { for iNdEx := len(m.UnpackedNestedEnum) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedNestedEnum[iNdEx])) i-- dAtA[i] = 0x6 i-- @@ -5115,7 +5116,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.UnpackedSint64) > 0 { for iNdEx := len(m.UnpackedSint64) - 1; iNdEx >= 0; iNdEx-- { x3 := (uint64(m.UnpackedSint64[iNdEx]) << 1) ^ uint64((m.UnpackedSint64[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x3)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x3)) i-- dAtA[i] = 0x5 i-- @@ -5125,7 +5126,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.UnpackedSint32) > 0 { for iNdEx := len(m.UnpackedSint32) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint32(m.UnpackedSint32[iNdEx]) << 1) ^ uint32((m.UnpackedSint32[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x5 i-- @@ -5134,7 +5135,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedUint64) > 0 { for iNdEx := len(m.UnpackedUint64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -5143,7 +5144,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedUint32) > 0 { for iNdEx := len(m.UnpackedUint32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedUint32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -5152,7 +5153,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedInt64) > 0 { for iNdEx := len(m.UnpackedInt64) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt64[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -5161,7 +5162,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } if len(m.UnpackedInt32) > 0 { for iNdEx := len(m.UnpackedInt32) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UnpackedInt32[iNdEx])) i-- dAtA[i] = 0x5 i-- @@ -5171,7 +5172,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedNestedEnum) > 0 { var pksize6 int for _, num := range m.PackedNestedEnum { - pksize6 += sov(uint64(num)) + pksize6 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize6 j5 := i @@ -5185,7 +5186,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j5] = uint8(num) j5++ } - i = encodeVarint(dAtA, i, uint64(pksize6)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize6)) i-- dAtA[i] = 0x5 i-- @@ -5200,7 +5201,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.PackedBool))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedBool))) i-- dAtA[i] = 0x5 i-- @@ -5212,7 +5213,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f7)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedDouble)*8)) i-- dAtA[i] = 0x5 i-- @@ -5224,7 +5225,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f8)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFloat)*4)) i-- dAtA[i] = 0x5 i-- @@ -5235,7 +5236,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedSfixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -5246,7 +5247,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedSfixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedSfixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -5257,7 +5258,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedFixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed64)*8)) i-- dAtA[i] = 0x5 i-- @@ -5268,7 +5269,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedFixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedFixed32)*4)) i-- dAtA[i] = 0x5 i-- @@ -5277,7 +5278,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedSint64) > 0 { var pksize10 int for _, num := range m.PackedSint64 { - pksize10 += soz(uint64(num)) + pksize10 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize10 j9 := i @@ -5291,7 +5292,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j9] = uint8(x11) j9++ } - i = encodeVarint(dAtA, i, uint64(pksize10)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize10)) i-- dAtA[i] = 0x5 i-- @@ -5300,7 +5301,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedSint32) > 0 { var pksize13 int for _, num := range m.PackedSint32 { - pksize13 += soz(uint64(num)) + pksize13 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize13 j12 := i @@ -5314,7 +5315,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j12] = uint8(x14) j12++ } - i = encodeVarint(dAtA, i, uint64(pksize13)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize13)) i-- dAtA[i] = 0x4 i-- @@ -5323,7 +5324,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedUint64) > 0 { var pksize16 int for _, num := range m.PackedUint64 { - pksize16 += sov(uint64(num)) + pksize16 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize16 j15 := i @@ -5336,7 +5337,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j15] = uint8(num) j15++ } - i = encodeVarint(dAtA, i, uint64(pksize16)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize16)) i-- dAtA[i] = 0x4 i-- @@ -5345,7 +5346,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedUint32) > 0 { var pksize18 int for _, num := range m.PackedUint32 { - pksize18 += sov(uint64(num)) + pksize18 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize18 j17 := i @@ -5358,7 +5359,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j17] = uint8(num) j17++ } - i = encodeVarint(dAtA, i, uint64(pksize18)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize18)) i-- dAtA[i] = 0x4 i-- @@ -5367,7 +5368,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedInt64) > 0 { var pksize20 int for _, num := range m.PackedInt64 { - pksize20 += sov(uint64(num)) + pksize20 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize20 j19 := i @@ -5381,7 +5382,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j19] = uint8(num) j19++ } - i = encodeVarint(dAtA, i, uint64(pksize20)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize20)) i-- dAtA[i] = 0x4 i-- @@ -5390,7 +5391,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.PackedInt32) > 0 { var pksize22 int for _, num := range m.PackedInt32 { - pksize22 += sov(uint64(num)) + pksize22 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize22 j21 := i @@ -5404,7 +5405,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j21] = uint8(num) j21++ } - i = encodeVarint(dAtA, i, uint64(pksize22)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize22)) i-- dAtA[i] = 0x4 i-- @@ -5414,15 +5415,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapStringForeignEnum { v := m.MapStringForeignEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5433,15 +5434,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapStringNestedEnum { v := m.MapStringNestedEnum[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5457,15 +5458,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5481,15 +5482,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5502,15 +5503,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5523,15 +5524,15 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5558,7 +5559,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err } i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5573,10 +5574,10 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(v)))) i-- dAtA[i] = 0x11 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5591,10 +5592,10 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(v)))) i-- dAtA[i] = 0x15 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5613,7 +5614,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5632,7 +5633,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4 i-- @@ -5651,7 +5652,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint64(dAtA[i:], uint64(k)) i-- dAtA[i] = 0x9 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5670,7 +5671,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err binary.LittleEndian.PutUint32(dAtA[i:], uint32(k)) i-- dAtA[i] = 0xd - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5681,13 +5682,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapSint64Sint64 { v := m.MapSint64Sint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(v)<<1)^uint64((v>>63)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(k)<<1)^uint64((k>>63)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5698,13 +5699,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapSint32Sint32 { v := m.MapSint32Sint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5715,13 +5716,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapUint64Uint64 { v := m.MapUint64Uint64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5732,13 +5733,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapUint32Uint32 { v := m.MapUint32Uint32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5749,13 +5750,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapInt64Int64 { v := m.MapInt64Int64[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5766,13 +5767,13 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for k := range m.MapInt32Int32 { v := m.MapInt32Int32[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3 i-- @@ -5783,7 +5784,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedCord) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedCord[iNdEx]) copy(dAtA[i:], m.RepeatedCord[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedCord[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -5794,7 +5795,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedStringPiece) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedStringPiece[iNdEx]) copy(dAtA[i:], m.RepeatedStringPiece[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedStringPiece[iNdEx]))) i-- dAtA[i] = 0x3 i-- @@ -5804,7 +5805,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedForeignEnum) > 0 { var pksize24 int for _, num := range m.RepeatedForeignEnum { - pksize24 += sov(uint64(num)) + pksize24 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize24 j23 := i @@ -5818,7 +5819,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j23] = uint8(num) j23++ } - i = encodeVarint(dAtA, i, uint64(pksize24)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize24)) i-- dAtA[i] = 0x3 i-- @@ -5827,7 +5828,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedNestedEnum) > 0 { var pksize26 int for _, num := range m.RepeatedNestedEnum { - pksize26 += sov(uint64(num)) + pksize26 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize26 j25 := i @@ -5841,7 +5842,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j25] = uint8(num) j25++ } - i = encodeVarint(dAtA, i, uint64(pksize26)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize26)) i-- dAtA[i] = 0x3 i-- @@ -5854,7 +5855,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -5868,7 +5869,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3 i-- @@ -5879,7 +5880,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedBytes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedBytes[iNdEx]) copy(dAtA[i:], m.RepeatedBytes[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedBytes[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -5890,7 +5891,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err for iNdEx := len(m.RepeatedString) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedString[iNdEx]) copy(dAtA[i:], m.RepeatedString[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedString[iNdEx]))) i-- dAtA[i] = 0x2 i-- @@ -5906,7 +5907,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedBool))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedBool))) i-- dAtA[i] = 0x2 i-- @@ -5918,7 +5919,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f27)) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedDouble)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedDouble)*8)) i-- dAtA[i] = 0x2 i-- @@ -5930,7 +5931,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f28)) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedFloat)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedFloat)*4)) i-- dAtA[i] = 0x2 i-- @@ -5941,7 +5942,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.RepeatedSfixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed64)*8)) i-- dAtA[i] = 0x2 i-- @@ -5952,7 +5953,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.RepeatedSfixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedSfixed32)*4)) i-- dAtA[i] = 0x2 i-- @@ -5963,7 +5964,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.RepeatedFixed64[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedFixed64)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedFixed64)*8)) i-- dAtA[i] = 0x2 i-- @@ -5974,7 +5975,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.RepeatedFixed32[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedFixed32)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedFixed32)*4)) i-- dAtA[i] = 0x2 i-- @@ -5983,7 +5984,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedSint64) > 0 { var pksize30 int for _, num := range m.RepeatedSint64 { - pksize30 += soz(uint64(num)) + pksize30 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize30 j29 := i @@ -5997,7 +5998,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j29] = uint8(x31) j29++ } - i = encodeVarint(dAtA, i, uint64(pksize30)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize30)) i-- dAtA[i] = 0x2 i-- @@ -6006,7 +6007,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedSint32) > 0 { var pksize33 int for _, num := range m.RepeatedSint32 { - pksize33 += soz(uint64(num)) + pksize33 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize33 j32 := i @@ -6020,7 +6021,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j32] = uint8(x34) j32++ } - i = encodeVarint(dAtA, i, uint64(pksize33)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize33)) i-- dAtA[i] = 0x2 i-- @@ -6029,7 +6030,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedUint64) > 0 { var pksize36 int for _, num := range m.RepeatedUint64 { - pksize36 += sov(uint64(num)) + pksize36 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize36 j35 := i @@ -6042,7 +6043,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j35] = uint8(num) j35++ } - i = encodeVarint(dAtA, i, uint64(pksize36)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize36)) i-- dAtA[i] = 0x2 i-- @@ -6051,7 +6052,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedUint32) > 0 { var pksize38 int for _, num := range m.RepeatedUint32 { - pksize38 += sov(uint64(num)) + pksize38 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize38 j37 := i @@ -6064,7 +6065,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j37] = uint8(num) j37++ } - i = encodeVarint(dAtA, i, uint64(pksize38)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize38)) i-- dAtA[i] = 0x2 i-- @@ -6073,7 +6074,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedInt64) > 0 { var pksize40 int for _, num := range m.RepeatedInt64 { - pksize40 += sov(uint64(num)) + pksize40 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize40 j39 := i @@ -6087,7 +6088,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j39] = uint8(num) j39++ } - i = encodeVarint(dAtA, i, uint64(pksize40)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize40)) i-- dAtA[i] = 0x2 i-- @@ -6096,7 +6097,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.RepeatedInt32) > 0 { var pksize42 int for _, num := range m.RepeatedInt32 { - pksize42 += sov(uint64(num)) + pksize42 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize42 j41 := i @@ -6110,7 +6111,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[j41] = uint8(num) j41++ } - i = encodeVarint(dAtA, i, uint64(pksize42)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize42)) i-- dAtA[i] = 0x1 i-- @@ -6122,7 +6123,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -6131,7 +6132,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.OptionalCord) > 0 { i -= len(m.OptionalCord) copy(dAtA[i:], m.OptionalCord) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalCord))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalCord))) i-- dAtA[i] = 0x1 i-- @@ -6140,28 +6141,28 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.OptionalStringPiece) > 0 { i -= len(m.OptionalStringPiece) copy(dAtA[i:], m.OptionalStringPiece) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalStringPiece))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalStringPiece))) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xc2 } if m.OptionalAliasedEnum != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalAliasedEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalAliasedEnum)) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xb8 } if m.OptionalForeignEnum != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalForeignEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalForeignEnum)) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xb0 } if m.OptionalNestedEnum != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalNestedEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalNestedEnum)) i-- dAtA[i] = 0x1 i-- @@ -6173,7 +6174,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -6185,7 +6186,7 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -6194,14 +6195,14 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.OptionalBytes) > 0 { i -= len(m.OptionalBytes) copy(dAtA[i:], m.OptionalBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) i-- dAtA[i] = 0x7a } if len(m.OptionalString) > 0 { i -= len(m.OptionalString) copy(dAtA[i:], m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalString))) i-- dAtA[i] = 0x72 } @@ -6252,32 +6253,32 @@ func (m *TestAllTypesProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err dAtA[i] = 0x3d } if m.OptionalSint64 != 0 { - i = encodeVarint(dAtA, i, uint64((uint64(m.OptionalSint64)<<1)^uint64((m.OptionalSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(m.OptionalSint64)<<1)^uint64((m.OptionalSint64>>63)))) i-- dAtA[i] = 0x30 } if m.OptionalSint32 != 0 { - i = encodeVarint(dAtA, i, uint64((uint32(m.OptionalSint32)<<1)^uint32((m.OptionalSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(m.OptionalSint32)<<1)^uint32((m.OptionalSint32>>31)))) i-- dAtA[i] = 0x28 } if m.OptionalUint64 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalUint64)) i-- dAtA[i] = 0x20 } if m.OptionalUint32 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalUint32)) i-- dAtA[i] = 0x18 } if m.OptionalInt64 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalInt64)) i-- dAtA[i] = 0x10 } if m.OptionalInt32 != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OptionalInt32)) i-- dAtA[i] = 0x8 } @@ -6291,7 +6292,7 @@ func (m *TestAllTypesProto3_OneofUint32) MarshalToVTStrict(dAtA []byte) (int, er func (m *TestAllTypesProto3_OneofUint32) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint32)) i-- dAtA[i] = 0x6 i-- @@ -6311,7 +6312,7 @@ func (m *TestAllTypesProto3_OneofNestedMessage) MarshalToSizedBufferVTStrict(dAt return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -6328,7 +6329,7 @@ func (m *TestAllTypesProto3_OneofString) MarshalToSizedBufferVTStrict(dAtA []byt i := len(dAtA) i -= len(m.OneofString) copy(dAtA[i:], m.OneofString) - i = encodeVarint(dAtA, i, uint64(len(m.OneofString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofString))) i-- dAtA[i] = 0x7 i-- @@ -6344,7 +6345,7 @@ func (m *TestAllTypesProto3_OneofBytes) MarshalToSizedBufferVTStrict(dAtA []byte i := len(dAtA) i -= len(m.OneofBytes) copy(dAtA[i:], m.OneofBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OneofBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OneofBytes))) i-- dAtA[i] = 0x7 i-- @@ -6377,7 +6378,7 @@ func (m *TestAllTypesProto3_OneofUint64) MarshalToVTStrict(dAtA []byte) (int, er func (m *TestAllTypesProto3_OneofUint64) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofUint64)) i-- dAtA[i] = 0x7 i-- @@ -6421,7 +6422,7 @@ func (m *TestAllTypesProto3_OneofEnum) MarshalToVTStrict(dAtA []byte) (int, erro func (m *TestAllTypesProto3_OneofEnum) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofEnum)) i-- dAtA[i] = 0x7 i-- @@ -6435,7 +6436,7 @@ func (m *TestAllTypesProto3_OneofNullValue) MarshalToVTStrict(dAtA []byte) (int, func (m *TestAllTypesProto3_OneofNullValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.OneofNullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OneofNullValue)) i-- dAtA[i] = 0x7 i-- @@ -6473,7 +6474,7 @@ func (m *ForeignMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if m.C != 0 { - i = encodeVarint(dAtA, i, uint64(m.C)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.C)) i-- dAtA[i] = 0x8 } @@ -6553,11 +6554,11 @@ func (m *TestAllTypesProto3_NestedMessage) SizeVT() (n int) { var l int _ = l if m.A != 0 { - n += 1 + sov(uint64(m.A)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.A)) } if m.Corecursive != nil { l = m.Corecursive.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -6570,22 +6571,22 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { var l int _ = l if m.OptionalInt32 != 0 { - n += 1 + sov(uint64(m.OptionalInt32)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OptionalInt32)) } if m.OptionalInt64 != 0 { - n += 1 + sov(uint64(m.OptionalInt64)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OptionalInt64)) } if m.OptionalUint32 != 0 { - n += 1 + sov(uint64(m.OptionalUint32)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OptionalUint32)) } if m.OptionalUint64 != 0 { - n += 1 + sov(uint64(m.OptionalUint64)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OptionalUint64)) } if m.OptionalSint32 != 0 { - n += 1 + soz(uint64(m.OptionalSint32)) + n += 1 + protohelpers.SizeOfZigzag(uint64(m.OptionalSint32)) } if m.OptionalSint64 != 0 { - n += 1 + soz(uint64(m.OptionalSint64)) + n += 1 + protohelpers.SizeOfZigzag(uint64(m.OptionalSint64)) } if m.OptionalFixed32 != 0 { n += 5 @@ -6610,200 +6611,200 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { } l = len(m.OptionalString) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.OptionalBytes) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalNestedMessage != nil { l = m.OptionalNestedMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalForeignMessage != nil { l = m.OptionalForeignMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalNestedEnum != 0 { - n += 2 + sov(uint64(m.OptionalNestedEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OptionalNestedEnum)) } if m.OptionalForeignEnum != 0 { - n += 2 + sov(uint64(m.OptionalForeignEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OptionalForeignEnum)) } if m.OptionalAliasedEnum != 0 { - n += 2 + sov(uint64(m.OptionalAliasedEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OptionalAliasedEnum)) } l = len(m.OptionalStringPiece) if l > 0 { - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.OptionalCord) if l > 0 { - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.RecursiveMessage != nil { l = m.RecursiveMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.RepeatedInt32) > 0 { l = 0 for _, e := range m.RepeatedInt32 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedInt64) > 0 { l = 0 for _, e := range m.RepeatedInt64 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedUint32) > 0 { l = 0 for _, e := range m.RepeatedUint32 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedUint64) > 0 { l = 0 for _, e := range m.RepeatedUint64 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedSint32) > 0 { l = 0 for _, e := range m.RepeatedSint32 { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedSint64) > 0 { l = 0 for _, e := range m.RepeatedSint64 { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedFixed32) > 0 { - n += 2 + sov(uint64(len(m.RepeatedFixed32)*4)) + len(m.RepeatedFixed32)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.RepeatedFixed32)*4)) + len(m.RepeatedFixed32)*4 } if len(m.RepeatedFixed64) > 0 { - n += 2 + sov(uint64(len(m.RepeatedFixed64)*8)) + len(m.RepeatedFixed64)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.RepeatedFixed64)*8)) + len(m.RepeatedFixed64)*8 } if len(m.RepeatedSfixed32) > 0 { - n += 2 + sov(uint64(len(m.RepeatedSfixed32)*4)) + len(m.RepeatedSfixed32)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.RepeatedSfixed32)*4)) + len(m.RepeatedSfixed32)*4 } if len(m.RepeatedSfixed64) > 0 { - n += 2 + sov(uint64(len(m.RepeatedSfixed64)*8)) + len(m.RepeatedSfixed64)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.RepeatedSfixed64)*8)) + len(m.RepeatedSfixed64)*8 } if len(m.RepeatedFloat) > 0 { - n += 2 + sov(uint64(len(m.RepeatedFloat)*4)) + len(m.RepeatedFloat)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.RepeatedFloat)*4)) + len(m.RepeatedFloat)*4 } if len(m.RepeatedDouble) > 0 { - n += 2 + sov(uint64(len(m.RepeatedDouble)*8)) + len(m.RepeatedDouble)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.RepeatedDouble)*8)) + len(m.RepeatedDouble)*8 } if len(m.RepeatedBool) > 0 { - n += 2 + sov(uint64(len(m.RepeatedBool))) + len(m.RepeatedBool)*1 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.RepeatedBool))) + len(m.RepeatedBool)*1 } if len(m.RepeatedString) > 0 { for _, s := range m.RepeatedString { l = len(s) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedBytes) > 0 { for _, b := range m.RepeatedBytes { l = len(b) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedNestedMessage) > 0 { for _, e := range m.RepeatedNestedMessage { l = e.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedForeignMessage) > 0 { for _, e := range m.RepeatedForeignMessage { l = e.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedNestedEnum) > 0 { l = 0 for _, e := range m.RepeatedNestedEnum { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedForeignEnum) > 0 { l = 0 for _, e := range m.RepeatedForeignEnum { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.RepeatedStringPiece) > 0 { for _, s := range m.RepeatedStringPiece { l = len(s) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedCord) > 0 { for _, s := range m.RepeatedCord { l = len(s) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.MapInt32Int32) > 0 { for k, v := range m.MapInt32Int32 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapInt64Int64) > 0 { for k, v := range m.MapInt64Int64 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapUint32Uint32) > 0 { for k, v := range m.MapUint32Uint32 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapUint64Uint64) > 0 { for k, v := range m.MapUint64Uint64 { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSint32Sint32) > 0 { for k, v := range m.MapSint32Sint32 { _ = k _ = v - mapEntrySize := 1 + soz(uint64(k)) + 1 + soz(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfZigzag(uint64(k)) + 1 + protohelpers.SizeOfZigzag(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSint64Sint64) > 0 { for k, v := range m.MapSint64Sint64 { _ = k _ = v - mapEntrySize := 1 + soz(uint64(k)) + 1 + soz(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfZigzag(uint64(k)) + 1 + protohelpers.SizeOfZigzag(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapFixed32Fixed32) > 0 { @@ -6811,7 +6812,7 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 4 + 1 + 4 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapFixed64Fixed64) > 0 { @@ -6819,7 +6820,7 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 8 + 1 + 8 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSfixed32Sfixed32) > 0 { @@ -6827,7 +6828,7 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 4 + 1 + 4 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapSfixed64Sfixed64) > 0 { @@ -6835,23 +6836,23 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 8 + 1 + 8 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapInt32Float) > 0 { for k, v := range m.MapInt32Float { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + 4 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + 4 + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapInt32Double) > 0 { for k, v := range m.MapInt32Double { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + 8 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + 8 + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapBoolBool) > 0 { @@ -6859,24 +6860,24 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { _ = k _ = v mapEntrySize := 1 + 1 + 1 + 1 - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringString) > 0 { for k, v := range m.MapStringString { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringBytes) > 0 { for k, v := range m.MapStringBytes { _ = k _ = v - l = 1 + len(v) + sov(uint64(len(v))) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + l = 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringNestedMessage) > 0 { @@ -6887,9 +6888,9 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { if v != nil { l = v.SizeVT() } - l += 1 + sov(uint64(l)) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringForeignMessage) > 0 { @@ -6900,125 +6901,125 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { if v != nil { l = v.SizeVT() } - l += 1 + sov(uint64(l)) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringNestedEnum) > 0 { for k, v := range m.MapStringNestedEnum { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.MapStringForeignEnum) > 0 { for k, v := range m.MapStringForeignEnum { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + sov(uint64(v)) - n += mapEntrySize + 2 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.PackedInt32) > 0 { l = 0 for _, e := range m.PackedInt32 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedInt64) > 0 { l = 0 for _, e := range m.PackedInt64 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedUint32) > 0 { l = 0 for _, e := range m.PackedUint32 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedUint64) > 0 { l = 0 for _, e := range m.PackedUint64 { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedSint32) > 0 { l = 0 for _, e := range m.PackedSint32 { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedSint64) > 0 { l = 0 for _, e := range m.PackedSint64 { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.PackedFixed32) > 0 { - n += 2 + sov(uint64(len(m.PackedFixed32)*4)) + len(m.PackedFixed32)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedFixed32)*4)) + len(m.PackedFixed32)*4 } if len(m.PackedFixed64) > 0 { - n += 2 + sov(uint64(len(m.PackedFixed64)*8)) + len(m.PackedFixed64)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedFixed64)*8)) + len(m.PackedFixed64)*8 } if len(m.PackedSfixed32) > 0 { - n += 2 + sov(uint64(len(m.PackedSfixed32)*4)) + len(m.PackedSfixed32)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedSfixed32)*4)) + len(m.PackedSfixed32)*4 } if len(m.PackedSfixed64) > 0 { - n += 2 + sov(uint64(len(m.PackedSfixed64)*8)) + len(m.PackedSfixed64)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedSfixed64)*8)) + len(m.PackedSfixed64)*8 } if len(m.PackedFloat) > 0 { - n += 2 + sov(uint64(len(m.PackedFloat)*4)) + len(m.PackedFloat)*4 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedFloat)*4)) + len(m.PackedFloat)*4 } if len(m.PackedDouble) > 0 { - n += 2 + sov(uint64(len(m.PackedDouble)*8)) + len(m.PackedDouble)*8 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedDouble)*8)) + len(m.PackedDouble)*8 } if len(m.PackedBool) > 0 { - n += 2 + sov(uint64(len(m.PackedBool))) + len(m.PackedBool)*1 + n += 2 + protohelpers.SizeOfVarint(uint64(len(m.PackedBool))) + len(m.PackedBool)*1 } if len(m.PackedNestedEnum) > 0 { l = 0 for _, e := range m.PackedNestedEnum { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 2 + sov(uint64(l)) + l + n += 2 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.UnpackedInt32) > 0 { for _, e := range m.UnpackedInt32 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedInt64) > 0 { for _, e := range m.UnpackedInt64 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedUint32) > 0 { for _, e := range m.UnpackedUint32 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedUint64) > 0 { for _, e := range m.UnpackedUint64 { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.UnpackedSint32) > 0 { for _, e := range m.UnpackedSint32 { - n += 2 + soz(uint64(e)) + n += 2 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.UnpackedSint64) > 0 { for _, e := range m.UnpackedSint64 { - n += 2 + soz(uint64(e)) + n += 2 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.UnpackedFixed32) > 0 { @@ -7044,7 +7045,7 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { } if len(m.UnpackedNestedEnum) > 0 { for _, e := range m.UnpackedNestedEnum { - n += 2 + sov(uint64(e)) + n += 2 + protohelpers.SizeOfVarint(uint64(e)) } } if vtmsg, ok := m.OneofField.(interface{ SizeVT() int }); ok { @@ -7052,216 +7053,216 @@ func (m *TestAllTypesProto3) SizeVT() (n int) { } if m.OptionalBoolWrapper != nil { l = (*wrapperspb1.BoolValue)(m.OptionalBoolWrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalInt32Wrapper != nil { l = (*wrapperspb1.Int32Value)(m.OptionalInt32Wrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalInt64Wrapper != nil { l = (*wrapperspb1.Int64Value)(m.OptionalInt64Wrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalUint32Wrapper != nil { l = (*wrapperspb1.UInt32Value)(m.OptionalUint32Wrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalUint64Wrapper != nil { l = (*wrapperspb1.UInt64Value)(m.OptionalUint64Wrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalFloatWrapper != nil { l = (*wrapperspb1.FloatValue)(m.OptionalFloatWrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalDoubleWrapper != nil { l = (*wrapperspb1.DoubleValue)(m.OptionalDoubleWrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalStringWrapper != nil { l = (*wrapperspb1.StringValue)(m.OptionalStringWrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalBytesWrapper != nil { l = (*wrapperspb1.BytesValue)(m.OptionalBytesWrapper).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.RepeatedBoolWrapper) > 0 { for _, e := range m.RepeatedBoolWrapper { l = (*wrapperspb1.BoolValue)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedInt32Wrapper) > 0 { for _, e := range m.RepeatedInt32Wrapper { l = (*wrapperspb1.Int32Value)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedInt64Wrapper) > 0 { for _, e := range m.RepeatedInt64Wrapper { l = (*wrapperspb1.Int64Value)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedUint32Wrapper) > 0 { for _, e := range m.RepeatedUint32Wrapper { l = (*wrapperspb1.UInt32Value)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedUint64Wrapper) > 0 { for _, e := range m.RepeatedUint64Wrapper { l = (*wrapperspb1.UInt64Value)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedFloatWrapper) > 0 { for _, e := range m.RepeatedFloatWrapper { l = (*wrapperspb1.FloatValue)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedDoubleWrapper) > 0 { for _, e := range m.RepeatedDoubleWrapper { l = (*wrapperspb1.DoubleValue)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedStringWrapper) > 0 { for _, e := range m.RepeatedStringWrapper { l = (*wrapperspb1.StringValue)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedBytesWrapper) > 0 { for _, e := range m.RepeatedBytesWrapper { l = (*wrapperspb1.BytesValue)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.OptionalDuration != nil { l = (*durationpb1.Duration)(m.OptionalDuration).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalTimestamp != nil { l = (*timestamppb1.Timestamp)(m.OptionalTimestamp).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalFieldMask != nil { l = (*fieldmaskpb1.FieldMask)(m.OptionalFieldMask).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalStruct != nil { l = (*structpb1.Struct)(m.OptionalStruct).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalAny != nil { l = (*anypb1.Any)(m.OptionalAny).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalValue != nil { l = (*structpb1.Value)(m.OptionalValue).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalNullValue != 0 { - n += 2 + sov(uint64(m.OptionalNullValue)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OptionalNullValue)) } if len(m.RepeatedDuration) > 0 { for _, e := range m.RepeatedDuration { l = (*durationpb1.Duration)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedTimestamp) > 0 { for _, e := range m.RepeatedTimestamp { l = (*timestamppb1.Timestamp)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedFieldmask) > 0 { for _, e := range m.RepeatedFieldmask { l = (*fieldmaskpb1.FieldMask)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedAny) > 0 { for _, e := range m.RepeatedAny { l = (*anypb1.Any)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedValue) > 0 { for _, e := range m.RepeatedValue { l = (*structpb1.Value)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedListValue) > 0 { for _, e := range m.RepeatedListValue { l = (*structpb1.ListValue)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RepeatedStruct) > 0 { for _, e := range m.RepeatedStruct { l = (*structpb1.Struct)(e).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Fieldname1 != 0 { - n += 2 + sov(uint64(m.Fieldname1)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Fieldname1)) } if m.FieldName2 != 0 { - n += 2 + sov(uint64(m.FieldName2)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.FieldName2)) } if m.XFieldName3 != 0 { - n += 2 + sov(uint64(m.XFieldName3)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.XFieldName3)) } if m.Field_Name4_ != 0 { - n += 2 + sov(uint64(m.Field_Name4_)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Field_Name4_)) } if m.Field0Name5 != 0 { - n += 2 + sov(uint64(m.Field0Name5)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Field0Name5)) } if m.Field_0Name6 != 0 { - n += 2 + sov(uint64(m.Field_0Name6)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Field_0Name6)) } if m.FieldName7 != 0 { - n += 2 + sov(uint64(m.FieldName7)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.FieldName7)) } if m.FieldName8 != 0 { - n += 2 + sov(uint64(m.FieldName8)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.FieldName8)) } if m.Field_Name9 != 0 { - n += 2 + sov(uint64(m.Field_Name9)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Field_Name9)) } if m.Field_Name10 != 0 { - n += 2 + sov(uint64(m.Field_Name10)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Field_Name10)) } if m.FIELD_NAME11 != 0 { - n += 2 + sov(uint64(m.FIELD_NAME11)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.FIELD_NAME11)) } if m.FIELDName12 != 0 { - n += 2 + sov(uint64(m.FIELDName12)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.FIELDName12)) } if m.XFieldName13 != 0 { - n += 2 + sov(uint64(m.XFieldName13)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.XFieldName13)) } if m.X_FieldName14 != 0 { - n += 2 + sov(uint64(m.X_FieldName14)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.X_FieldName14)) } if m.Field_Name15 != 0 { - n += 2 + sov(uint64(m.Field_Name15)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Field_Name15)) } if m.Field__Name16 != 0 { - n += 2 + sov(uint64(m.Field__Name16)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.Field__Name16)) } if m.FieldName17__ != 0 { - n += 2 + sov(uint64(m.FieldName17__)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.FieldName17__)) } if m.FieldName18__ != 0 { - n += 2 + sov(uint64(m.FieldName18__)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.FieldName18__)) } n += len(m.unknownFields) return n @@ -7273,7 +7274,7 @@ func (m *TestAllTypesProto3_OneofUint32) SizeVT() (n int) { } var l int _ = l - n += 2 + sov(uint64(m.OneofUint32)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OneofUint32)) return n } func (m *TestAllTypesProto3_OneofNestedMessage) SizeVT() (n int) { @@ -7284,7 +7285,7 @@ func (m *TestAllTypesProto3_OneofNestedMessage) SizeVT() (n int) { _ = l if m.OneofNestedMessage != nil { l = m.OneofNestedMessage.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -7295,7 +7296,7 @@ func (m *TestAllTypesProto3_OneofString) SizeVT() (n int) { var l int _ = l l = len(m.OneofString) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *TestAllTypesProto3_OneofBytes) SizeVT() (n int) { @@ -7305,7 +7306,7 @@ func (m *TestAllTypesProto3_OneofBytes) SizeVT() (n int) { var l int _ = l l = len(m.OneofBytes) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *TestAllTypesProto3_OneofBool) SizeVT() (n int) { @@ -7323,7 +7324,7 @@ func (m *TestAllTypesProto3_OneofUint64) SizeVT() (n int) { } var l int _ = l - n += 2 + sov(uint64(m.OneofUint64)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OneofUint64)) return n } func (m *TestAllTypesProto3_OneofFloat) SizeVT() (n int) { @@ -7350,7 +7351,7 @@ func (m *TestAllTypesProto3_OneofEnum) SizeVT() (n int) { } var l int _ = l - n += 2 + sov(uint64(m.OneofEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OneofEnum)) return n } func (m *TestAllTypesProto3_OneofNullValue) SizeVT() (n int) { @@ -7359,7 +7360,7 @@ func (m *TestAllTypesProto3_OneofNullValue) SizeVT() (n int) { } var l int _ = l - n += 2 + sov(uint64(m.OneofNullValue)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.OneofNullValue)) return n } func (m *ForeignMessage) SizeVT() (n int) { @@ -7369,7 +7370,7 @@ func (m *ForeignMessage) SizeVT() (n int) { var l int _ = l if m.C != 0 { - n += 1 + sov(uint64(m.C)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.C)) } n += len(m.unknownFields) return n @@ -7403,7 +7404,7 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7431,7 +7432,7 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVT(dAtA []byte) error { m.A = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7450,7 +7451,7 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7463,11 +7464,11 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7481,12 +7482,12 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7509,7 +7510,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7537,7 +7538,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalInt32 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7556,7 +7557,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalInt64 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7575,7 +7576,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalUint32 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7594,7 +7595,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalUint64 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7613,7 +7614,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7634,7 +7635,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7717,7 +7718,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7737,7 +7738,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7751,11 +7752,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7769,7 +7770,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7782,11 +7783,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7803,7 +7804,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7816,11 +7817,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7839,7 +7840,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7852,11 +7853,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7875,7 +7876,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalNestedEnum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7894,7 +7895,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalForeignEnum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7913,7 +7914,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalAliasedEnum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7932,7 +7933,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7946,11 +7947,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7964,7 +7965,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7978,11 +7979,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7996,7 +7997,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8009,11 +8010,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8030,7 +8031,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8047,7 +8048,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8060,11 +8061,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8084,7 +8085,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8106,7 +8107,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8123,7 +8124,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8136,11 +8137,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8160,7 +8161,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8182,7 +8183,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8199,7 +8200,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8212,11 +8213,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8236,7 +8237,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8258,7 +8259,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8275,7 +8276,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8288,11 +8289,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8312,7 +8313,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8334,7 +8335,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8352,7 +8353,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8365,11 +8366,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8389,7 +8390,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8412,7 +8413,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8430,7 +8431,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8443,11 +8444,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8467,7 +8468,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8498,7 +8499,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8511,11 +8512,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8550,7 +8551,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8563,11 +8564,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8602,7 +8603,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8615,11 +8616,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8654,7 +8655,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8667,11 +8668,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8707,7 +8708,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8720,11 +8721,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8761,7 +8762,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8774,11 +8775,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8806,7 +8807,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8823,7 +8824,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8836,11 +8837,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8854,7 +8855,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8878,7 +8879,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8892,11 +8893,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8910,7 +8911,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8923,11 +8924,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8942,7 +8943,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8955,11 +8956,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8976,7 +8977,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8989,11 +8990,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9008,7 +9009,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9025,7 +9026,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9038,11 +9039,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9055,7 +9056,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9077,7 +9078,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v ForeignEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9094,7 +9095,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9107,11 +9108,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9124,7 +9125,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v ForeignEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9148,7 +9149,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9162,11 +9163,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9180,7 +9181,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9194,11 +9195,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9212,7 +9213,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9225,11 +9226,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9244,7 +9245,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9260,7 +9261,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9275,7 +9276,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9289,12 +9290,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9311,7 +9312,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9324,11 +9325,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9343,7 +9344,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9359,7 +9360,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9374,7 +9375,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9388,12 +9389,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9410,7 +9411,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9423,11 +9424,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9442,7 +9443,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9458,7 +9459,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9473,7 +9474,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9487,12 +9488,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9509,7 +9510,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9522,11 +9523,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9541,7 +9542,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9557,7 +9558,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9572,7 +9573,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9586,12 +9587,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9608,7 +9609,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9621,11 +9622,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9640,7 +9641,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9657,7 +9658,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapkeytemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9675,7 +9676,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapvaluetemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9691,12 +9692,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { mapvalue = int32(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9713,7 +9714,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9726,11 +9727,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9745,7 +9746,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9762,7 +9763,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapkeytemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9780,7 +9781,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapvaluetemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9796,12 +9797,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { mapvalue = int64(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9818,7 +9819,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9831,11 +9832,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9850,7 +9851,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9877,12 +9878,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9899,7 +9900,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9912,11 +9913,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9931,7 +9932,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9958,12 +9959,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9980,7 +9981,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9993,11 +9994,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10012,7 +10013,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10039,12 +10040,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10061,7 +10062,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10074,11 +10075,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10093,7 +10094,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10120,12 +10121,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10142,7 +10143,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10155,11 +10156,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10174,7 +10175,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10190,7 +10191,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10212,12 +10213,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { mapvalue = math.Float32frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10234,7 +10235,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10247,11 +10248,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10266,7 +10267,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10282,7 +10283,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10304,12 +10305,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { mapvalue = math.Float64frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10326,7 +10327,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10339,11 +10340,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10358,7 +10359,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10375,7 +10376,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapkeytemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10392,7 +10393,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapvaluetemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10407,12 +10408,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { mapvalue = bool(mapvaluetemp != 0) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10429,7 +10430,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10442,11 +10443,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10461,7 +10462,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10478,7 +10479,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10492,11 +10493,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -10507,7 +10508,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10521,11 +10522,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -10534,12 +10535,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10556,7 +10557,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10569,11 +10570,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10588,7 +10589,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10605,7 +10606,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10619,11 +10620,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -10634,7 +10635,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10648,11 +10649,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postbytesIndex > l { return io.ErrUnexpectedEOF @@ -10662,12 +10663,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx = postbytesIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10684,7 +10685,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10697,11 +10698,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10716,7 +10717,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10733,7 +10734,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10747,11 +10748,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -10762,7 +10763,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10775,11 +10776,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -10791,12 +10792,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10813,7 +10814,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10826,11 +10827,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10845,7 +10846,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10862,7 +10863,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10876,11 +10877,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -10891,7 +10892,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10904,11 +10905,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -10920,12 +10921,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -10942,7 +10943,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10955,11 +10956,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10974,7 +10975,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10991,7 +10992,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11005,11 +11006,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -11019,7 +11020,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11033,12 +11034,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -11055,7 +11056,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11068,11 +11069,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11087,7 +11088,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11104,7 +11105,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11118,11 +11119,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -11132,7 +11133,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11146,12 +11147,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -11166,7 +11167,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11183,7 +11184,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11196,11 +11197,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11220,7 +11221,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11242,7 +11243,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11259,7 +11260,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11272,11 +11273,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11296,7 +11297,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11318,7 +11319,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11335,7 +11336,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11348,11 +11349,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11372,7 +11373,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11394,7 +11395,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11411,7 +11412,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11424,11 +11425,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11448,7 +11449,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11470,7 +11471,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11488,7 +11489,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11501,11 +11502,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11525,7 +11526,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11548,7 +11549,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11566,7 +11567,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11579,11 +11580,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11603,7 +11604,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11634,7 +11635,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11647,11 +11648,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11686,7 +11687,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11699,11 +11700,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11738,7 +11739,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11751,11 +11752,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11790,7 +11791,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11803,11 +11804,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11843,7 +11844,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11856,11 +11857,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11897,7 +11898,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11910,11 +11911,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11942,7 +11943,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11959,7 +11960,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11972,11 +11973,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -11990,7 +11991,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12012,7 +12013,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12029,7 +12030,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12042,11 +12043,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12059,7 +12060,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12081,7 +12082,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12098,7 +12099,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12111,11 +12112,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12135,7 +12136,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12157,7 +12158,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12174,7 +12175,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12187,11 +12188,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12211,7 +12212,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12233,7 +12234,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12250,7 +12251,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12263,11 +12264,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12287,7 +12288,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12309,7 +12310,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12326,7 +12327,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12339,11 +12340,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12363,7 +12364,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12385,7 +12386,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12403,7 +12404,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12416,11 +12417,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12440,7 +12441,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12463,7 +12464,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12481,7 +12482,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12494,11 +12495,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12518,7 +12519,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12549,7 +12550,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12562,11 +12563,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12601,7 +12602,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12614,11 +12615,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12653,7 +12654,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12666,11 +12667,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12705,7 +12706,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12718,11 +12719,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12758,7 +12759,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12771,11 +12772,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12812,7 +12813,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12825,11 +12826,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12857,7 +12858,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12874,7 +12875,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12887,11 +12888,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12905,7 +12906,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12927,7 +12928,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12944,7 +12945,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12957,11 +12958,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -12974,7 +12975,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12998,7 +12999,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13018,7 +13019,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13031,11 +13032,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13059,7 +13060,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13073,11 +13074,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13091,7 +13092,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13104,11 +13105,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13124,7 +13125,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13145,7 +13146,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13187,7 +13188,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13207,7 +13208,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var v structpb.NullValue for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13227,7 +13228,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13240,11 +13241,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13263,7 +13264,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13276,11 +13277,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13299,7 +13300,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13312,11 +13313,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13335,7 +13336,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13348,11 +13349,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13371,7 +13372,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13384,11 +13385,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13407,7 +13408,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13420,11 +13421,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13443,7 +13444,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13456,11 +13457,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13479,7 +13480,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13492,11 +13493,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13515,7 +13516,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13528,11 +13529,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13551,7 +13552,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13564,11 +13565,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13585,7 +13586,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13598,11 +13599,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13619,7 +13620,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13632,11 +13633,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13653,7 +13654,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13666,11 +13667,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13687,7 +13688,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13700,11 +13701,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13721,7 +13722,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13734,11 +13735,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13755,7 +13756,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13768,11 +13769,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13789,7 +13790,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13802,11 +13803,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13823,7 +13824,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13836,11 +13837,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13857,7 +13858,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13870,11 +13871,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13893,7 +13894,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13906,11 +13907,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13929,7 +13930,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13942,11 +13943,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -13965,7 +13966,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13978,11 +13979,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14001,7 +14002,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14014,11 +14015,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14037,7 +14038,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14050,11 +14051,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14073,7 +14074,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.OptionalNullValue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14092,7 +14093,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14105,11 +14106,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14126,7 +14127,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14139,11 +14140,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14160,7 +14161,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14173,11 +14174,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14194,7 +14195,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14207,11 +14208,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14228,7 +14229,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14241,11 +14242,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14262,7 +14263,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14275,11 +14276,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14296,7 +14297,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14309,11 +14310,11 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14330,7 +14331,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Fieldname1 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14349,7 +14350,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.FieldName2 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14368,7 +14369,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.XFieldName3 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14387,7 +14388,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Field_Name4_ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14406,7 +14407,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Field0Name5 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14425,7 +14426,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Field_0Name6 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14444,7 +14445,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.FieldName7 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14463,7 +14464,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.FieldName8 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14482,7 +14483,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Field_Name9 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14501,7 +14502,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Field_Name10 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14520,7 +14521,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.FIELD_NAME11 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14539,7 +14540,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.FIELDName12 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14558,7 +14559,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.XFieldName13 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14577,7 +14578,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.X_FieldName14 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14596,7 +14597,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Field_Name15 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14615,7 +14616,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.Field__Name16 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14634,7 +14635,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.FieldName17__ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14653,7 +14654,7 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { m.FieldName18__ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14667,12 +14668,12 @@ func (m *TestAllTypesProto3) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14695,7 +14696,7 @@ func (m *ForeignMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14723,7 +14724,7 @@ func (m *ForeignMessage) UnmarshalVT(dAtA []byte) error { m.C = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14737,12 +14738,12 @@ func (m *ForeignMessage) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14765,7 +14766,7 @@ func (m *NullHypothesisProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14788,12 +14789,12 @@ func (m *NullHypothesisProto3) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14816,7 +14817,7 @@ func (m *EnumOnlyProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14839,12 +14840,12 @@ func (m *EnumOnlyProto3) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14867,7 +14868,7 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14895,7 +14896,7 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error m.A = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14914,7 +14915,7 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14927,11 +14928,11 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -14945,12 +14946,12 @@ func (m *TestAllTypesProto3_NestedMessage) UnmarshalVTUnsafe(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14973,7 +14974,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15001,7 +15002,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalInt32 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15020,7 +15021,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalInt64 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15039,7 +15040,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalUint32 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15058,7 +15059,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalUint64 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15077,7 +15078,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15098,7 +15099,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15181,7 +15182,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15201,7 +15202,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15215,11 +15216,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15233,7 +15234,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15246,11 +15247,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15264,7 +15265,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15277,11 +15278,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15300,7 +15301,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15313,11 +15314,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15336,7 +15337,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalNestedEnum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15355,7 +15356,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalForeignEnum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15374,7 +15375,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalAliasedEnum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15393,7 +15394,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15407,11 +15408,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15425,7 +15426,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15439,11 +15440,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15457,7 +15458,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15470,11 +15471,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15491,7 +15492,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15508,7 +15509,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15521,11 +15522,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15545,7 +15546,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15567,7 +15568,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15584,7 +15585,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15597,11 +15598,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15621,7 +15622,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15643,7 +15644,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15660,7 +15661,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15673,11 +15674,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15697,7 +15698,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15719,7 +15720,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15736,7 +15737,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15749,11 +15750,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15773,7 +15774,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15795,7 +15796,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15813,7 +15814,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15826,11 +15827,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15850,7 +15851,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15873,7 +15874,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15891,7 +15892,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15904,11 +15905,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -15928,7 +15929,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15959,7 +15960,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15972,11 +15973,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16011,7 +16012,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16024,11 +16025,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16063,7 +16064,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16076,11 +16077,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16115,7 +16116,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16128,11 +16129,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16168,7 +16169,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16181,11 +16182,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16222,7 +16223,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16235,11 +16236,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16267,7 +16268,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16284,7 +16285,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16297,11 +16298,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16315,7 +16316,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16339,7 +16340,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16353,11 +16354,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16371,7 +16372,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16384,11 +16385,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16402,7 +16403,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16415,11 +16416,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16436,7 +16437,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16449,11 +16450,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16468,7 +16469,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16485,7 +16486,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16498,11 +16499,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16515,7 +16516,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16537,7 +16538,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v ForeignEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16554,7 +16555,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16567,11 +16568,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16584,7 +16585,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v ForeignEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16608,7 +16609,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16622,11 +16623,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16640,7 +16641,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16654,11 +16655,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16672,7 +16673,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16685,11 +16686,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16704,7 +16705,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16720,7 +16721,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16735,7 +16736,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16749,12 +16750,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -16771,7 +16772,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16784,11 +16785,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16803,7 +16804,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16819,7 +16820,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16834,7 +16835,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16848,12 +16849,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -16870,7 +16871,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16883,11 +16884,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -16902,7 +16903,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16918,7 +16919,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16933,7 +16934,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16947,12 +16948,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -16969,7 +16970,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -16982,11 +16983,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17001,7 +17002,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17017,7 +17018,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17032,7 +17033,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17046,12 +17047,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17068,7 +17069,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17081,11 +17082,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17100,7 +17101,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17117,7 +17118,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapkeytemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17135,7 +17136,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapvaluetemp int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17151,12 +17152,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = int32(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17173,7 +17174,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17186,11 +17187,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17205,7 +17206,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17222,7 +17223,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapkeytemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17240,7 +17241,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapvaluetemp uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17256,12 +17257,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = int64(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17278,7 +17279,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17291,11 +17292,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17310,7 +17311,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17337,12 +17338,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17359,7 +17360,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17372,11 +17373,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17391,7 +17392,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17418,12 +17419,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17440,7 +17441,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17453,11 +17454,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17472,7 +17473,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17499,12 +17500,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 4 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17521,7 +17522,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17534,11 +17535,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17553,7 +17554,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17580,12 +17581,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += 8 } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17602,7 +17603,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17615,11 +17616,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17634,7 +17635,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17650,7 +17651,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17672,12 +17673,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = math.Float32frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17694,7 +17695,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17707,11 +17708,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17726,7 +17727,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17742,7 +17743,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17764,12 +17765,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = math.Float64frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17786,7 +17787,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17799,11 +17800,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17818,7 +17819,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17835,7 +17836,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapkeytemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17852,7 +17853,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapvaluetemp int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17867,12 +17868,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { mapvalue = bool(mapvaluetemp != 0) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -17889,7 +17890,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17902,11 +17903,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -17921,7 +17922,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17938,7 +17939,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17952,11 +17953,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -17967,7 +17968,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -17981,11 +17982,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -17994,12 +17995,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18016,7 +18017,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18029,11 +18030,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18048,7 +18049,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18065,7 +18066,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18079,11 +18080,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18094,7 +18095,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18108,11 +18109,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postbytesIndex > l { return io.ErrUnexpectedEOF @@ -18121,12 +18122,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postbytesIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18143,7 +18144,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18156,11 +18157,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18175,7 +18176,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18192,7 +18193,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18206,11 +18207,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18221,7 +18222,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18234,11 +18235,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -18250,12 +18251,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18272,7 +18273,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18285,11 +18286,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18304,7 +18305,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18321,7 +18322,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18335,11 +18336,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18350,7 +18351,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18363,11 +18364,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -18379,12 +18380,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18401,7 +18402,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18414,11 +18415,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18433,7 +18434,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18450,7 +18451,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18464,11 +18465,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18478,7 +18479,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18492,12 +18493,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18514,7 +18515,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18527,11 +18528,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18546,7 +18547,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18563,7 +18564,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18577,11 +18578,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -18591,7 +18592,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18605,12 +18606,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -18625,7 +18626,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18642,7 +18643,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18655,11 +18656,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18679,7 +18680,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18701,7 +18702,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18718,7 +18719,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18731,11 +18732,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18755,7 +18756,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18777,7 +18778,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18794,7 +18795,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18807,11 +18808,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18831,7 +18832,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18853,7 +18854,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18870,7 +18871,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18883,11 +18884,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18907,7 +18908,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18929,7 +18930,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18947,7 +18948,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18960,11 +18961,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -18984,7 +18985,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19007,7 +19008,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19025,7 +19026,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19038,11 +19039,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19062,7 +19063,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19093,7 +19094,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19106,11 +19107,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19145,7 +19146,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19158,11 +19159,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19197,7 +19198,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19210,11 +19211,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19249,7 +19250,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19262,11 +19263,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19302,7 +19303,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19315,11 +19316,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19356,7 +19357,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19369,11 +19370,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19401,7 +19402,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19418,7 +19419,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19431,11 +19432,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19449,7 +19450,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19471,7 +19472,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19488,7 +19489,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19501,11 +19502,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19518,7 +19519,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19540,7 +19541,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19557,7 +19558,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19570,11 +19571,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19594,7 +19595,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19616,7 +19617,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19633,7 +19634,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19646,11 +19647,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19670,7 +19671,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19692,7 +19693,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19709,7 +19710,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19722,11 +19723,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19746,7 +19747,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19768,7 +19769,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19785,7 +19786,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19798,11 +19799,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19822,7 +19823,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19844,7 +19845,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19862,7 +19863,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19875,11 +19876,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19899,7 +19900,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19922,7 +19923,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19940,7 +19941,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -19953,11 +19954,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -19977,7 +19978,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20008,7 +20009,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20021,11 +20022,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20060,7 +20061,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20073,11 +20074,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20112,7 +20113,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20125,11 +20126,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20164,7 +20165,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20177,11 +20178,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20217,7 +20218,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20230,11 +20231,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20271,7 +20272,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20284,11 +20285,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20316,7 +20317,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20333,7 +20334,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20346,11 +20347,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20364,7 +20365,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20386,7 +20387,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20403,7 +20404,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20416,11 +20417,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20433,7 +20434,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20457,7 +20458,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20477,7 +20478,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20490,11 +20491,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20518,7 +20519,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20532,11 +20533,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20550,7 +20551,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20563,11 +20564,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20582,7 +20583,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20603,7 +20604,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20645,7 +20646,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v TestAllTypesProto3_NestedEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20665,7 +20666,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v structpb.NullValue for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20685,7 +20686,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20698,11 +20699,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20721,7 +20722,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20734,11 +20735,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20757,7 +20758,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20770,11 +20771,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20793,7 +20794,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20806,11 +20807,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20829,7 +20830,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20842,11 +20843,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20865,7 +20866,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20878,11 +20879,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20901,7 +20902,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20914,11 +20915,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20937,7 +20938,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20950,11 +20951,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -20973,7 +20974,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -20986,11 +20987,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21009,7 +21010,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21022,11 +21023,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21043,7 +21044,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21056,11 +21057,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21077,7 +21078,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21090,11 +21091,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21111,7 +21112,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21124,11 +21125,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21145,7 +21146,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21158,11 +21159,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21179,7 +21180,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21192,11 +21193,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21213,7 +21214,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21226,11 +21227,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21247,7 +21248,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21260,11 +21261,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21281,7 +21282,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21294,11 +21295,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21315,7 +21316,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21328,11 +21329,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21351,7 +21352,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21364,11 +21365,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21387,7 +21388,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21400,11 +21401,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21423,7 +21424,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21436,11 +21437,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21459,7 +21460,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21472,11 +21473,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21495,7 +21496,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21508,11 +21509,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21531,7 +21532,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalNullValue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21550,7 +21551,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21563,11 +21564,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21584,7 +21585,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21597,11 +21598,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21618,7 +21619,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21631,11 +21632,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21652,7 +21653,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21665,11 +21666,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21686,7 +21687,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21699,11 +21700,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21720,7 +21721,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21733,11 +21734,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21754,7 +21755,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21767,11 +21768,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -21788,7 +21789,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Fieldname1 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21807,7 +21808,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.FieldName2 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21826,7 +21827,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.XFieldName3 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21845,7 +21846,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Field_Name4_ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21864,7 +21865,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Field0Name5 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21883,7 +21884,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Field_0Name6 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21902,7 +21903,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.FieldName7 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21921,7 +21922,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.FieldName8 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21940,7 +21941,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Field_Name9 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21959,7 +21960,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Field_Name10 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21978,7 +21979,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.FIELD_NAME11 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -21997,7 +21998,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.FIELDName12 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22016,7 +22017,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.XFieldName13 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22035,7 +22036,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.X_FieldName14 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22054,7 +22055,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Field_Name15 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22073,7 +22074,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.Field__Name16 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22092,7 +22093,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.FieldName17__ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22111,7 +22112,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.FieldName18__ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22125,12 +22126,12 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -22153,7 +22154,7 @@ func (m *ForeignMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22181,7 +22182,7 @@ func (m *ForeignMessage) UnmarshalVTUnsafe(dAtA []byte) error { m.C = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22195,12 +22196,12 @@ func (m *ForeignMessage) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -22223,7 +22224,7 @@ func (m *NullHypothesisProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22246,12 +22247,12 @@ func (m *NullHypothesisProto3) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -22274,7 +22275,7 @@ func (m *EnumOnlyProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -22297,12 +22298,12 @@ func (m *EnumOnlyProto3) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/features/clone/clone.go b/features/clone/clone.go index 7955ebf..187a5a8 100644 --- a/features/clone/clone.go +++ b/features/clone/clone.go @@ -48,9 +48,6 @@ func (p *clone) GenerateFile(file *protogen.File) bool { return p.once } -func (p *clone) GenerateHelpers() { -} - // cloneOneofField generates the statements for cloning a oneof field func (p *clone) cloneOneofField(lhsBase, rhsBase string, oneof *protogen.Oneof) { fieldname := oneof.GoName diff --git a/features/equal/equal.go b/features/equal/equal.go index 8d5d6fe..3b51584 100644 --- a/features/equal/equal.go +++ b/features/equal/equal.go @@ -29,8 +29,8 @@ type equal struct { var _ generator.FeatureGenerator = (*equal)(nil) -func (p *equal) Name() string { return "equal" } -func (p *equal) GenerateHelpers() {} +func (p *equal) Name() string { return "equal" } + func (p *equal) GenerateFile(file *protogen.File) bool { proto3 := file.Desc.Syntax() == protoreflect.Proto3 for _, message := range file.Messages { diff --git a/features/grpc/grpc_plugin.go b/features/grpc/grpc_plugin.go index 5212b9e..7676872 100644 --- a/features/grpc/grpc_plugin.go +++ b/features/grpc/grpc_plugin.go @@ -32,5 +32,3 @@ func (g *grpc) GenerateFile(file *protogen.File) bool { generateFileContent(nil, file, g.GeneratedFile) return true } - -func (g *grpc) GenerateHelpers() {} diff --git a/features/marshal/marshalto.go b/features/marshal/marshalto.go index b54b084..9f323ce 100644 --- a/features/marshal/marshalto.go +++ b/features/marshal/marshalto.go @@ -52,22 +52,6 @@ func (p *marshal) GenerateFile(file *protogen.File) bool { return p.once } -func (p *marshal) GenerateHelpers() { - p.Helper("encodeVarint", func(p *generator.GeneratedFile) { - p.P(`func encodeVarint(dAtA []byte, offset int, v uint64) int {`) - p.P(`offset -= sov(v)`) - p.P(`base := offset`) - p.P(`for v >= 1<<7 {`) - p.P(`dAtA[offset] = uint8(v&0x7f|0x80)`) - p.P(`v >>= 7`) - p.P(`offset++`) - p.P(`}`) - p.P(`dAtA[offset] = uint8(v)`) - p.P(`return base`) - p.P(`}`) - }) -} - func (p *marshal) encodeFixed64(varName ...string) { p.P(`i -= 8`) p.P(p.Ident("encoding/binary", "LittleEndian"), `.PutUint64(dAtA[i:], uint64(`, strings.Join(varName, ""), `))`) @@ -79,7 +63,7 @@ func (p *marshal) encodeFixed32(varName ...string) { } func (p *marshal) encodeVarint(varName ...string) { - p.P(`i = encodeVarint(dAtA, i, uint64(`, strings.Join(varName, ""), `))`) + p.P(`i = `, p.Helper("EncodeVarint"), `(dAtA, i, uint64(`, strings.Join(varName, ""), `))`) } func (p *marshal) encodeKey(fieldNumber protoreflect.FieldNumber, wireType protowire.Type) { @@ -210,7 +194,7 @@ func (p *marshal) field(oneof bool, numGen *counter, field *protogen.Field) { p.P(`var `, total, ` int`) p.P(`for _, num := range m.`, fieldname, ` {`) - p.P(total, ` += sov(uint64(num))`) + p.P(total, ` += `, p.Helper("SizeOfVarint"), `(uint64(num))`) p.P(`}`) p.P(`i -= `, total) @@ -452,7 +436,7 @@ func (p *marshal) field(oneof bool, numGen *counter, field *protogen.Field) { p.P(`var `, total, ` int`) p.P(`for _, num := range m.`, fieldname, ` {`) - p.P(total, ` += soz(uint64(num))`) + p.P(total, ` += `, p.Helper("SizeOfZigzag"), `(uint64(num))`) p.P(`}`) p.P(`i -= `, total) p.P(jvar, `:= i`) @@ -496,7 +480,7 @@ func (p *marshal) field(oneof bool, numGen *counter, field *protogen.Field) { p.P(`var `, total, ` int`) p.P(`for _, num := range m.`, fieldname, ` {`) - p.P(total, ` += soz(uint64(num))`) + p.P(total, ` += `, p.Helper("SizeOfZigzag"), `(uint64(num))`) p.P(`}`) p.P(`i -= `, total) p.P(jvar, `:= i`) diff --git a/features/pool/pool.go b/features/pool/pool.go index efb0f41..1148b70 100644 --- a/features/pool/pool.go +++ b/features/pool/pool.go @@ -22,8 +22,6 @@ type pool struct { var _ generator.FeatureGenerator = (*pool)(nil) -func (p *pool) GenerateHelpers() {} - func (p *pool) GenerateFile(file *protogen.File) bool { for _, message := range file.Messages { p.message(message) diff --git a/features/size/size.go b/features/size/size.go index b4db606..61bf3da 100644 --- a/features/size/size.go +++ b/features/size/size.go @@ -7,7 +7,6 @@ package size import ( "strconv" - "strings" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/encoding/protowire" @@ -41,20 +40,6 @@ func (p *size) GenerateFile(file *protogen.File) bool { return p.once } -func (p *size) GenerateHelpers() { - p.Helper("sov", func(p *generator.GeneratedFile) { - p.P(` - func sov(x uint64) (n int) { - return (`, p.Ident("math/bits", "Len64"), `(x | 1) + 6)/ 7 - }`) - }) - p.Helper("soz", func(p *generator.GeneratedFile) { - p.P(`func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) - }`) - }) -} - func (p *size) messageSize(varName, sizeName string, message *protogen.Message) { switch { case p.IsWellKnownType(message): @@ -93,7 +78,7 @@ func (p *size) field(oneof bool, field *protogen.Field, sizeName string) { switch field.Desc.Kind() { case protoreflect.DoubleKind, protoreflect.Fixed64Kind, protoreflect.Sfixed64Kind: if packed { - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(len(m.`, fieldname, `)*8))`, `+len(m.`, fieldname, `)*8`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(len(m.`, fieldname, `)*8))`, `+len(m.`, fieldname, `)*8`) } else if repeated { p.P(`n+=`, strconv.Itoa(key+8), `*len(m.`, fieldname, `)`) } else if !oneof && !nullable { @@ -105,7 +90,7 @@ func (p *size) field(oneof bool, field *protogen.Field, sizeName string) { } case protoreflect.FloatKind, protoreflect.Fixed32Kind, protoreflect.Sfixed32Kind: if packed { - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(len(m.`, fieldname, `)*4))`, `+len(m.`, fieldname, `)*4`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(len(m.`, fieldname, `)*4))`, `+len(m.`, fieldname, `)*4`) } else if repeated { p.P(`n+=`, strconv.Itoa(key+4), `*len(m.`, fieldname, `)`) } else if !oneof && !nullable { @@ -119,25 +104,25 @@ func (p *size) field(oneof bool, field *protogen.Field, sizeName string) { if packed { p.P(`l = 0`) p.P(`for _, e := range m.`, fieldname, ` {`) - p.P(`l+=sov(uint64(e))`) + p.P(`l+=`, p.Helper("SizeOfVarint"), `(uint64(e))`) p.P(`}`) - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(l))+l`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(l))+l`) } else if repeated { p.P(`for _, e := range m.`, fieldname, ` {`) - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(e))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(e))`) p.P(`}`) } else if nullable { - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(*m.`, fieldname, `))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(*m.`, fieldname, `))`) } else if !oneof { p.P(`if m.`, fieldname, ` != 0 {`) - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(m.`, fieldname, `))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(m.`, fieldname, `))`) p.P(`}`) } else { - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(m.`, fieldname, `))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(m.`, fieldname, `))`) } case protoreflect.BoolKind: if packed { - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(len(m.`, fieldname, `)))`, `+len(m.`, fieldname, `)*1`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(len(m.`, fieldname, `)))`, `+len(m.`, fieldname, `)*1`) } else if repeated { p.P(`n+=`, strconv.Itoa(key+1), `*len(m.`, fieldname, `)`) } else if !oneof && !nullable { @@ -151,19 +136,19 @@ func (p *size) field(oneof bool, field *protogen.Field, sizeName string) { if repeated { p.P(`for _, s := range m.`, fieldname, ` { `) p.P(`l = len(s)`) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) p.P(`}`) } else if nullable { p.P(`l=len(*m.`, fieldname, `)`) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) } else if !oneof { p.P(`l=len(m.`, fieldname, `)`) p.P(`if l > 0 {`) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) p.P(`}`) } else { p.P(`l=len(m.`, fieldname, `)`) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) } case protoreflect.GroupKind: p.messageSize("m."+fieldname, sizeName, field.Message) @@ -176,7 +161,7 @@ func (p *size) field(oneof bool, field *protogen.Field, sizeName string) { p.P(`for k, v := range m.`, fieldname, ` { `) p.P(`_ = k`) p.P(`_ = v`) - sum := []string{strconv.Itoa(keyKeySize)} + sum := []interface{}{strconv.Itoa(keyKeySize)} switch field.Message.Fields[0].Desc.Kind() { case protoreflect.DoubleKind, protoreflect.Fixed64Kind, protoreflect.Sfixed64Kind: @@ -184,13 +169,13 @@ func (p *size) field(oneof bool, field *protogen.Field, sizeName string) { case protoreflect.FloatKind, protoreflect.Fixed32Kind, protoreflect.Sfixed32Kind: sum = append(sum, `4`) case protoreflect.Int64Kind, protoreflect.Uint64Kind, protoreflect.Uint32Kind, protoreflect.EnumKind, protoreflect.Int32Kind: - sum = append(sum, `sov(uint64(k))`) + sum = append(sum, p.Helper("SizeOfVarint"), `(uint64(k))`) case protoreflect.BoolKind: sum = append(sum, `1`) case protoreflect.StringKind, protoreflect.BytesKind: - sum = append(sum, `len(k)+sov(uint64(len(k)))`) + sum = append(sum, `len(k)`, p.Helper("SizeOfVarint"), `(uint64(len(k)))`) case protoreflect.Sint32Kind, protoreflect.Sint64Kind: - sum = append(sum, `soz(uint64(k))`) + sum = append(sum, p.Helper("SizeOfZigzag"), `(uint64(k))`) } switch field.Message.Fields[1].Desc.Kind() { @@ -202,73 +187,81 @@ func (p *size) field(oneof bool, field *protogen.Field, sizeName string) { sum = append(sum, strconv.Itoa(4)) case protoreflect.Int64Kind, protoreflect.Uint64Kind, protoreflect.Uint32Kind, protoreflect.EnumKind, protoreflect.Int32Kind: sum = append(sum, strconv.Itoa(valueKeySize)) - sum = append(sum, `sov(uint64(v))`) + sum = append(sum, p.Helper("SizeOfVarint"), `(uint64(v))`) case protoreflect.BoolKind: sum = append(sum, strconv.Itoa(valueKeySize)) sum = append(sum, `1`) case protoreflect.StringKind: sum = append(sum, strconv.Itoa(valueKeySize)) - sum = append(sum, `len(v)+sov(uint64(len(v)))`) + sum = append(sum, `len(v)`, p.Helper("SizeOfVarint"), `(uint64(len(v)))`) case protoreflect.BytesKind: - p.P(`l = `, strconv.Itoa(valueKeySize), ` + len(v)+sov(uint64(len(v)))`) + p.P(`l = `, strconv.Itoa(valueKeySize), ` + len(v)+`, p.Helper("SizeOfVarint"), `(uint64(len(v)))`) sum = append(sum, `l`) case protoreflect.Sint32Kind, protoreflect.Sint64Kind: sum = append(sum, strconv.Itoa(valueKeySize)) - sum = append(sum, `soz(uint64(v))`) + sum = append(sum, p.Helper("SizeOfZigzag"), `(uint64(v))`) case protoreflect.MessageKind: p.P(`l = 0`) p.P(`if v != nil {`) p.messageSize("v", sizeName, field.Message.Fields[1].Message) p.P(`}`) - p.P(`l += `, strconv.Itoa(valueKeySize), ` + sov(uint64(l))`) + p.P(`l += `, strconv.Itoa(valueKeySize), ` + `, p.Helper("SizeOfVarint"), `(uint64(l))`) sum = append(sum, `l`) } - p.P(`mapEntrySize := `, strings.Join(sum, "+")) - p.P(`n+=mapEntrySize+`, fieldKeySize, `+sov(uint64(mapEntrySize))`) + mapEntrySize := []interface{}{"mapEntrySize := "} + for i, elt := range sum { + mapEntrySize = append(mapEntrySize, elt) + // if elt is not a string, then it is a helper function call + if _, ok := elt.(string); ok && i < len(sum)-1 { + mapEntrySize = append(mapEntrySize, "+") + } + } + p.P(mapEntrySize...) + p.P(`n+=mapEntrySize+`, fieldKeySize, `+`, p.Helper("SizeOfVarint"), `(uint64(mapEntrySize))`) p.P(`}`) } else if field.Desc.IsList() { p.P(`for _, e := range m.`, fieldname, ` { `) p.messageSize("e", sizeName, field.Message) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) p.P(`}`) } else { p.messageSize("m."+fieldname, sizeName, field.Message) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) } case protoreflect.BytesKind: if repeated { p.P(`for _, b := range m.`, fieldname, ` { `) p.P(`l = len(b)`) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) p.P(`}`) } else if !oneof && !field.Desc.HasPresence() { p.P(`l=len(m.`, fieldname, `)`) p.P(`if l > 0 {`) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) p.P(`}`) } else { p.P(`l=len(m.`, fieldname, `)`) - p.P(`n+=`, strconv.Itoa(key), `+l+sov(uint64(l))`) + p.P(`n+=`, strconv.Itoa(key), `+l+`, p.Helper("SizeOfVarint"), `(uint64(l))`) } case protoreflect.Sint32Kind, protoreflect.Sint64Kind: if packed { p.P(`l = 0`) p.P(`for _, e := range m.`, fieldname, ` {`) - p.P(`l+=soz(uint64(e))`) + p.P(`l+=`, p.Helper("SizeOfZigzag"), `(uint64(e))`) p.P(`}`) - p.P(`n+=`, strconv.Itoa(key), `+sov(uint64(l))+l`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfVarint"), `(uint64(l))+l`) } else if repeated { p.P(`for _, e := range m.`, fieldname, ` {`) - p.P(`n+=`, strconv.Itoa(key), `+soz(uint64(e))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfZigzag"), `(uint64(e))`) p.P(`}`) } else if nullable { - p.P(`n+=`, strconv.Itoa(key), `+soz(uint64(*m.`, fieldname, `))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfZigzag"), `(uint64(*m.`, fieldname, `))`) } else if !oneof { p.P(`if m.`, fieldname, ` != 0 {`) - p.P(`n+=`, strconv.Itoa(key), `+soz(uint64(m.`, fieldname, `))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfZigzag"), `(uint64(m.`, fieldname, `))`) p.P(`}`) } else { - p.P(`n+=`, strconv.Itoa(key), `+soz(uint64(m.`, fieldname, `))`) + p.P(`n+=`, strconv.Itoa(key), `+`, p.Helper("SizeOfZigzag"), `(uint64(m.`, fieldname, `))`) } default: panic("not implemented") diff --git a/features/unmarshal/unmarshal.go b/features/unmarshal/unmarshal.go index ae3edd8..2b8bc91 100644 --- a/features/unmarshal/unmarshal.go +++ b/features/unmarshal/unmarshal.go @@ -44,99 +44,6 @@ func (p *unmarshal) GenerateFile(file *protogen.File) bool { return p.once } -func (p *unmarshal) GenerateHelpers() { - p.Helper("skip", func(p *generator.GeneratedFile) { - p.P(` - func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, `, p.Ident("io", "ErrUnexpectedEOF"), ` - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, `, p.Ident("io", "ErrUnexpectedEOF"), ` - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, `, p.Ident("io", "ErrUnexpectedEOF"), ` - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, `, p.Ident("fmt", `Errorf`), `("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, `, p.Ident("io", "ErrUnexpectedEOF"), - `}`) - }) - - p.Helper("err", func(p *generator.GeneratedFile) { - p.P(` - var ( - ErrInvalidLength = `, p.Ident("fmt", "Errorf"), `("proto: negative length found during unmarshaling") - ErrIntOverflow = `, p.Ident("fmt", "Errorf"), `("proto: integer overflow") - ErrUnexpectedEndOfGroup = `, p.Ident("fmt", "Errorf"), `("proto: unexpected end of group") - )`) - }) -} - func (p *unmarshal) methodUnmarshal() string { if p.unsafe { return "UnmarshalVTUnsafe" @@ -174,7 +81,7 @@ func (p *unmarshal) decodeMessage(varName, buf string, message *protogen.Message func (p *unmarshal) decodeVarint(varName string, typName string) { p.P(`for shift := uint(0); ; shift += 7 {`) p.P(`if shift >= 64 {`) - p.P(`return ErrIntOverflow`) + p.P(`return `, p.Helper("ErrIntOverflow")) p.P(`}`) p.P(`if iNdEx >= l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -277,11 +184,11 @@ func (p *unmarshal) mapField(varName string, field *protogen.Field) { p.decodeVarint("stringLen"+varName, "uint64") p.P(`intStringLen`, varName, ` := int(stringLen`, varName, `)`) p.P(`if intStringLen`, varName, ` < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`postStringIndex`, varName, ` := iNdEx + intStringLen`, varName) p.P(`if postStringIndex`, varName, ` < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if postStringIndex`, varName, ` > l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -296,11 +203,11 @@ func (p *unmarshal) mapField(varName string, field *protogen.Field) { p.P(`var mapmsglen int`) p.decodeVarint("mapmsglen", "int") p.P(`if mapmsglen < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`postmsgIndex := iNdEx + mapmsglen`) p.P(`if postmsgIndex < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if postmsgIndex > l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -314,11 +221,11 @@ func (p *unmarshal) mapField(varName string, field *protogen.Field) { p.decodeVarint("mapbyteLen", "uint64") p.P(`intMapbyteLen := int(mapbyteLen)`) p.P(`if intMapbyteLen < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`postbytesIndex := iNdEx + intMapbyteLen`) p.P(`if postbytesIndex < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if postbytesIndex > l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -502,11 +409,11 @@ func (p *unmarshal) fieldItem(field *protogen.Field, fieldname string, message * p.decodeVarint("stringLen", "uint64") p.P(`intStringLen := int(stringLen)`) p.P(`if intStringLen < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`postIndex := iNdEx + intStringLen`) p.P(`if postIndex < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if postIndex > l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -537,12 +444,12 @@ func (p *unmarshal) fieldItem(field *protogen.Field, fieldname string, message * p.decodeMessage("m."+fieldname, "dAtA[groupStart:maybeGroupEnd]", field.Message) p.P(`break`) p.P(`}`) - p.P(`skippy, err := skip(dAtA[iNdEx:])`) + p.P(`skippy, err := `, p.Helper("Skip"), `(dAtA[iNdEx:])`) p.P(`if err != nil {`) p.P(`return err`) p.P(`}`) p.P(`if (skippy < 0) || (iNdEx + skippy) < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`iNdEx += skippy`) p.P(`}`) @@ -550,11 +457,11 @@ func (p *unmarshal) fieldItem(field *protogen.Field, fieldname string, message * p.P(`var msglen int`) p.decodeVarint("msglen", "int") p.P(`if msglen < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`postIndex := iNdEx + msglen`) p.P(`if postIndex < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if postIndex > l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -597,12 +504,12 @@ func (p *unmarshal) fieldItem(field *protogen.Field, fieldname string, message * p.mapField("mapvalue", field.Message.Fields[1]) p.P(`} else {`) p.P(`iNdEx = entryPreIndex`) - p.P(`skippy, err := skip(dAtA[iNdEx:])`) + p.P(`skippy, err := `, p.Helper("Skip"), `(dAtA[iNdEx:])`) p.P(`if err != nil {`) p.P(`return err`) p.P(`}`) p.P(`if (skippy < 0) || (iNdEx + skippy) < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if (iNdEx + skippy) > postIndex {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -643,11 +550,11 @@ func (p *unmarshal) fieldItem(field *protogen.Field, fieldname string, message * p.P(`var byteLen int`) p.decodeVarint("byteLen", "int") p.P(`if byteLen < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`postIndex := iNdEx + byteLen`) p.P(`if postIndex < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if postIndex > l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) @@ -794,11 +701,11 @@ func (p *unmarshal) field(proto3, oneof bool, field *protogen.Field, message *pr p.P(`var packedLen int`) p.decodeVarint("packedLen", "int") p.P(`if packedLen < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`postIndex := iNdEx + packedLen`) p.P(`if postIndex < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if postIndex > l {`) p.P(`return `, p.Ident("io", "ErrUnexpectedEOF")) @@ -896,12 +803,12 @@ func (p *unmarshal) message(proto3 bool, message *protogen.Message) { } p.P(`default:`) p.P(`iNdEx=preIndex`) - p.P(`skippy, err := skip(dAtA[iNdEx:])`) + p.P(`skippy, err := `, p.Helper("Skip"), `(dAtA[iNdEx:])`) p.P(`if err != nil {`) p.P(`return err`) p.P(`}`) p.P(`if (skippy < 0) || (iNdEx + skippy) < 0 {`) - p.P(`return ErrInvalidLength`) + p.P(`return `, p.Helper("ErrInvalidLength")) p.P(`}`) p.P(`if (iNdEx + skippy) > l {`) p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) diff --git a/generator/features.go b/generator/features.go index 34c6b25..c34e4e7 100644 --- a/generator/features.go +++ b/generator/features.go @@ -55,5 +55,4 @@ type Feature func(gen *GeneratedFile) FeatureGenerator type FeatureGenerator interface { GenerateFile(file *protogen.File) bool - GenerateHelpers() } diff --git a/generator/generatedfile.go b/generator/generatedfile.go index f51d3e7..d578082 100644 --- a/generator/generatedfile.go +++ b/generator/generatedfile.go @@ -18,16 +18,6 @@ type GeneratedFile struct { *protogen.GeneratedFile Config *Config LocalPackages map[protoreflect.FullName]bool - - helpers map[string]bool -} - -func (p *GeneratedFile) Helper(name string, generate func(p *GeneratedFile)) { - if p.helpers[name] { - return - } - generate(p) - p.helpers[name] = true } func (p *GeneratedFile) Ident(path, ident string) string { @@ -120,6 +110,22 @@ func (p *GeneratedFile) IsLocalField(field *protogen.Field) bool { return p.LocalPackages[pkg] } +const vtHelpersPackage = protogen.GoImportPath("github.com/planetscale/vtprotobuf/protohelpers") + +var helpers = map[string]protogen.GoIdent{ + "EncodeVarint": {GoName: "EncodeVarint", GoImportPath: vtHelpersPackage}, + "SizeOfVarint": {GoName: "SizeOfVarint", GoImportPath: vtHelpersPackage}, + "SizeOfZigzag": {GoName: "SizeOfZigzag", GoImportPath: vtHelpersPackage}, + "Skip": {GoName: "Skip", GoImportPath: vtHelpersPackage}, + "ErrInvalidLength": {GoName: "ErrInvalidLength", GoImportPath: vtHelpersPackage}, + "ErrIntOverflow": {GoName: "ErrIntOverflow", GoImportPath: vtHelpersPackage}, + "ErrUnexpectedEndOfGroup": {GoName: "ErrUnexpectedEndOfGroup", GoImportPath: vtHelpersPackage}, +} + +func (p *GeneratedFile) Helper(name string) protogen.GoIdent { + return helpers[name] +} + const vtWellKnownPackage = protogen.GoImportPath("github.com/planetscale/vtprotobuf/types/known/") var wellKnownTypes = map[protoreflect.FullName]protogen.GoIdent{ diff --git a/generator/generator.go b/generator/generator.go index 5f4cdbb..63abe3f 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -15,11 +15,6 @@ import ( "google.golang.org/protobuf/types/pluginpb" ) -type featureHelpers struct { - path protogen.GoImportPath - feature int -} - type ObjectSet map[protogen.GoIdent]bool func (o ObjectSet) String() string { @@ -52,7 +47,6 @@ type Generator struct { plugin *protogen.Plugin cfg *Config features []Feature - seen map[featureHelpers]bool local map[protoreflect.FullName]bool } @@ -77,7 +71,6 @@ func NewGenerator(plugin *protogen.Plugin, featureNames []string, cfg *Config) ( plugin: plugin, cfg: cfg, features: features, - seen: make(map[featureHelpers]bool), local: local, }, nil } @@ -103,7 +96,6 @@ func (gen *Generator) generateFile(gf *protogen.GeneratedFile, file *protogen.Fi GeneratedFile: gf, Config: gen.cfg, LocalPackages: gen.local, - helpers: make(map[string]bool), } p.P("// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.") @@ -136,19 +128,10 @@ func (gen *Generator) generateFile(gf *protogen.GeneratedFile, file *protogen.Fi } var generated bool - for fidx, feat := range gen.features { + for _, feat := range gen.features { featGenerator := feat(p) if featGenerator.GenerateFile(file) { generated = true - - helpersForPlugin := featureHelpers{ - path: file.GoImportPath, - feature: fidx, - } - if !gen.seen[helpersForPlugin] { - featGenerator.GenerateHelpers() - gen.seen[helpersForPlugin] = true - } } } diff --git a/testproto/grpc/grpc_vtproto.pb.go b/testproto/grpc/grpc_vtproto.pb.go index b046711..38b30d2 100644 --- a/testproto/grpc/grpc_vtproto.pb.go +++ b/testproto/grpc/grpc_vtproto.pb.go @@ -7,6 +7,7 @@ package grpc import ( context "context" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" inner "github.com/planetscale/vtprotobuf/testproto/grpc/inner" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -14,7 +15,6 @@ import ( proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" sync "sync" ) @@ -333,17 +333,6 @@ func (m *LocalTestMessageResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *LocalTestMessageRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -471,12 +460,6 @@ func (m *LocalTestMessageResponse) SizeVT() (n int) { return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *LocalTestMessageRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -485,7 +468,7 @@ func (m *LocalTestMessageRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -508,12 +491,12 @@ func (m *LocalTestMessageRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -536,7 +519,7 @@ func (m *LocalTestMessageResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -559,12 +542,12 @@ func (m *LocalTestMessageResponse) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -579,92 +562,6 @@ func (m *LocalTestMessageResponse) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *LocalTestMessageRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -673,7 +570,7 @@ func (m *LocalTestMessageRequest) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -696,12 +593,12 @@ func (m *LocalTestMessageRequest) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -724,7 +621,7 @@ func (m *LocalTestMessageResponse) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -747,12 +644,12 @@ func (m *LocalTestMessageResponse) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/grpc/inner/inner_vtproto.pb.go b/testproto/grpc/inner/inner_vtproto.pb.go index 530a488..31b6946 100644 --- a/testproto/grpc/inner/inner_vtproto.pb.go +++ b/testproto/grpc/inner/inner_vtproto.pb.go @@ -6,10 +6,10 @@ package inner import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" sync "sync" ) @@ -150,17 +150,6 @@ func (m *TestMessageResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *TestMessageRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -288,12 +277,6 @@ func (m *TestMessageResponse) SizeVT() (n int) { return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *TestMessageRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -302,7 +285,7 @@ func (m *TestMessageRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -325,12 +308,12 @@ func (m *TestMessageRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -353,7 +336,7 @@ func (m *TestMessageResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -376,12 +359,12 @@ func (m *TestMessageResponse) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -396,92 +379,6 @@ func (m *TestMessageResponse) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *TestMessageRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -490,7 +387,7 @@ func (m *TestMessageRequest) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -513,12 +410,12 @@ func (m *TestMessageRequest) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -541,7 +438,7 @@ func (m *TestMessageResponse) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -564,12 +461,12 @@ func (m *TestMessageResponse) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/pool/pool_vtproto.pb.go b/testproto/pool/pool_vtproto.pb.go index 510c66e..63dab38 100644 --- a/testproto/pool/pool_vtproto.pb.go +++ b/testproto/pool/pool_vtproto.pb.go @@ -6,10 +6,10 @@ package pool import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" sync "sync" unsafe "unsafe" ) @@ -166,36 +166,25 @@ func (m *MemoryPoolExtension) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } if m.Foo2 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Foo2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Foo2)) i-- dAtA[i] = 0x10 } if len(m.Foo1) > 0 { i -= len(m.Foo1) copy(dAtA[i:], m.Foo1) - i = encodeVarint(dAtA, i, uint64(len(m.Foo1))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Foo1))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *OptionalMessage) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -265,19 +254,19 @@ func (m *MemoryPoolExtension) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } if m.Foo2 != 0 { - i = encodeVarint(dAtA, i, uint64(m.Foo2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Foo2)) i-- dAtA[i] = 0x10 } if len(m.Foo1) > 0 { i -= len(m.Foo1) copy(dAtA[i:], m.Foo1) - i = encodeVarint(dAtA, i, uint64(len(m.Foo1))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Foo1))) i-- dAtA[i] = 0xa } @@ -344,25 +333,19 @@ func (m *MemoryPoolExtension) SizeVT() (n int) { _ = l l = len(m.Foo1) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Foo2 != 0 { - n += 1 + sov(uint64(m.Foo2)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Foo2)) } if m.Foo3 != nil { l = m.Foo3.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *OptionalMessage) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -371,7 +354,7 @@ func (m *OptionalMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -394,12 +377,12 @@ func (m *OptionalMessage) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -422,7 +405,7 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -450,7 +433,7 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -464,11 +447,11 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -482,7 +465,7 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { m.Foo2 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -501,7 +484,7 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -514,11 +497,11 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -532,12 +515,12 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -552,92 +535,6 @@ func (m *MemoryPoolExtension) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *OptionalMessage) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -646,7 +543,7 @@ func (m *OptionalMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -669,12 +566,12 @@ func (m *OptionalMessage) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -697,7 +594,7 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -725,7 +622,7 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -739,11 +636,11 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -757,7 +654,7 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { m.Foo2 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -776,7 +673,7 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -789,11 +686,11 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -807,12 +704,12 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/pool/pool_with_oneof_vtproto.pb.go b/testproto/pool/pool_with_oneof_vtproto.pb.go index 049dc2a..90a6a0d 100644 --- a/testproto/pool/pool_with_oneof_vtproto.pb.go +++ b/testproto/pool/pool_with_oneof_vtproto.pb.go @@ -6,6 +6,7 @@ package pool import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" @@ -382,7 +383,7 @@ func (m *OneofTest_Test1) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.A != 0 { - i = encodeVarint(dAtA, i, uint64(m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.A)) i-- dAtA[i] = 0x8 } @@ -423,7 +424,7 @@ func (m *OneofTest_Test2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.B) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.B[iNdEx]) copy(dAtA[i:], m.B[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) i-- dAtA[i] = 0xa } @@ -462,7 +463,7 @@ func (m *OneofTest_Test3_Element2) MarshalToSizedBufferVT(dAtA []byte) (int, err copy(dAtA[i:], m.unknownFields) } if m.D != 0 { - i = encodeVarint(dAtA, i, uint64(m.D)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.D)) i-- dAtA[i] = 0x8 } @@ -505,7 +506,7 @@ func (m *OneofTest_Test3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -567,7 +568,7 @@ func (m *OneofTest_Test1_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -586,7 +587,7 @@ func (m *OneofTest_Test2_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -605,7 +606,7 @@ func (m *OneofTest_Test3_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -620,7 +621,7 @@ func (m *OneofTest_Test4) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.Test4) copy(dAtA[i:], m.Test4) - i = encodeVarint(dAtA, i, uint64(len(m.Test4))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Test4))) i-- dAtA[i] = 0x22 return len(dAtA) - i, nil @@ -656,7 +657,7 @@ func (m *OneofTest_Test1) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if m.A != 0 { - i = encodeVarint(dAtA, i, uint64(m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.A)) i-- dAtA[i] = 0x8 } @@ -697,7 +698,7 @@ func (m *OneofTest_Test2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) for iNdEx := len(m.B) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.B[iNdEx]) copy(dAtA[i:], m.B[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) i-- dAtA[i] = 0xa } @@ -736,7 +737,7 @@ func (m *OneofTest_Test3_Element2) MarshalToSizedBufferVTStrict(dAtA []byte) (in copy(dAtA[i:], m.unknownFields) } if m.D != 0 { - i = encodeVarint(dAtA, i, uint64(m.D)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.D)) i-- dAtA[i] = 0x8 } @@ -779,7 +780,7 @@ func (m *OneofTest_Test3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -860,7 +861,7 @@ func (m *OneofTest_Test1_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -879,7 +880,7 @@ func (m *OneofTest_Test2_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -898,7 +899,7 @@ func (m *OneofTest_Test3_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -913,7 +914,7 @@ func (m *OneofTest_Test4) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i := len(dAtA) i -= len(m.Test4) copy(dAtA[i:], m.Test4) - i = encodeVarint(dAtA, i, uint64(len(m.Test4))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Test4))) i-- dAtA[i] = 0x22 return len(dAtA) - i, nil @@ -1042,7 +1043,7 @@ func (m *OneofTest_Test1) SizeVT() (n int) { var l int _ = l if m.A != 0 { - n += 1 + sov(uint64(m.A)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.A)) } n += len(m.unknownFields) return n @@ -1057,7 +1058,7 @@ func (m *OneofTest_Test2) SizeVT() (n int) { if len(m.B) > 0 { for _, s := range m.B { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1071,7 +1072,7 @@ func (m *OneofTest_Test3_Element2) SizeVT() (n int) { var l int _ = l if m.D != 0 { - n += 1 + sov(uint64(m.D)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.D)) } n += len(m.unknownFields) return n @@ -1085,7 +1086,7 @@ func (m *OneofTest_Test3) SizeVT() (n int) { _ = l if m.C != nil { l = m.C.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1112,7 +1113,7 @@ func (m *OneofTest_Test1_) SizeVT() (n int) { _ = l if m.Test1 != nil { l = m.Test1.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1124,7 +1125,7 @@ func (m *OneofTest_Test2_) SizeVT() (n int) { _ = l if m.Test2 != nil { l = m.Test2.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1136,7 +1137,7 @@ func (m *OneofTest_Test3_) SizeVT() (n int) { _ = l if m.Test3 != nil { l = m.Test3.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1147,7 +1148,7 @@ func (m *OneofTest_Test4) SizeVT() (n int) { var l int _ = l l = len(m.Test4) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *OneofTest_Test1) UnmarshalVT(dAtA []byte) error { @@ -1158,7 +1159,7 @@ func (m *OneofTest_Test1) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1186,7 +1187,7 @@ func (m *OneofTest_Test1) UnmarshalVT(dAtA []byte) error { m.A = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1200,12 +1201,12 @@ func (m *OneofTest_Test1) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1228,7 +1229,7 @@ func (m *OneofTest_Test2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1256,7 +1257,7 @@ func (m *OneofTest_Test2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1270,11 +1271,11 @@ func (m *OneofTest_Test2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1283,12 +1284,12 @@ func (m *OneofTest_Test2) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1311,7 +1312,7 @@ func (m *OneofTest_Test3_Element2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1339,7 +1340,7 @@ func (m *OneofTest_Test3_Element2) UnmarshalVT(dAtA []byte) error { m.D = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1353,12 +1354,12 @@ func (m *OneofTest_Test3_Element2) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1381,7 +1382,7 @@ func (m *OneofTest_Test3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1409,7 +1410,7 @@ func (m *OneofTest_Test3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1422,11 +1423,11 @@ func (m *OneofTest_Test3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1440,12 +1441,12 @@ func (m *OneofTest_Test3) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1468,7 +1469,7 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1496,7 +1497,7 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1509,11 +1510,11 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1537,7 +1538,7 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1550,11 +1551,11 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1578,7 +1579,7 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1591,11 +1592,11 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1619,7 +1620,7 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1632,11 +1633,11 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1647,12 +1648,12 @@ func (m *OneofTest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1675,7 +1676,7 @@ func (m *OneofTest_Test1) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1703,7 +1704,7 @@ func (m *OneofTest_Test1) UnmarshalVTUnsafe(dAtA []byte) error { m.A = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1717,12 +1718,12 @@ func (m *OneofTest_Test1) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1745,7 +1746,7 @@ func (m *OneofTest_Test2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1773,7 +1774,7 @@ func (m *OneofTest_Test2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1787,11 +1788,11 @@ func (m *OneofTest_Test2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1800,12 +1801,12 @@ func (m *OneofTest_Test2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1828,7 +1829,7 @@ func (m *OneofTest_Test3_Element2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1856,7 +1857,7 @@ func (m *OneofTest_Test3_Element2) UnmarshalVTUnsafe(dAtA []byte) error { m.D = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1870,12 +1871,12 @@ func (m *OneofTest_Test3_Element2) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1898,7 +1899,7 @@ func (m *OneofTest_Test3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1926,7 +1927,7 @@ func (m *OneofTest_Test3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1939,11 +1940,11 @@ func (m *OneofTest_Test3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1957,12 +1958,12 @@ func (m *OneofTest_Test3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1985,7 +1986,7 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2013,7 +2014,7 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2026,11 +2027,11 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2054,7 +2055,7 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2067,11 +2068,11 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2095,7 +2096,7 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2108,11 +2109,11 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2136,7 +2137,7 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2149,11 +2150,11 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2163,12 +2164,12 @@ func (m *OneofTest) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/pool/pool_with_slice_reuse_vtproto.pb.go b/testproto/pool/pool_with_slice_reuse_vtproto.pb.go index 441933b..5d285f5 100644 --- a/testproto/pool/pool_with_slice_reuse_vtproto.pb.go +++ b/testproto/pool/pool_with_slice_reuse_vtproto.pb.go @@ -6,6 +6,7 @@ package pool import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" @@ -276,7 +277,7 @@ func (m *Test1) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Sl) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Sl[iNdEx]) copy(dAtA[i:], m.Sl[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Sl[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Sl[iNdEx]))) i-- dAtA[i] = 0xa } @@ -321,7 +322,7 @@ func (m *Test2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -360,14 +361,14 @@ func (m *Slice2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.F != 0 { - i = encodeVarint(dAtA, i, uint64(m.F)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.F)) i-- dAtA[i] = 0x30 } if len(m.E) > 0 { i -= len(m.E) copy(dAtA[i:], m.E) - i = encodeVarint(dAtA, i, uint64(len(m.E))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.E))) i-- dAtA[i] = 0x2a } @@ -377,7 +378,7 @@ func (m *Slice2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -385,13 +386,13 @@ func (m *Slice2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.C[iNdEx]) copy(dAtA[i:], m.C[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.C[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.C[iNdEx]))) i-- dAtA[i] = 0x1a } } if m.B != nil { - i = encodeVarint(dAtA, i, uint64(*m.B)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.B)) i-- dAtA[i] = 0x10 } @@ -399,13 +400,13 @@ func (m *Slice2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for k := range m.A { v := m.A[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -444,7 +445,7 @@ func (m *Element2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.A != 0 { - i = encodeVarint(dAtA, i, uint64(m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.A)) i-- dAtA[i] = 0x8 } @@ -485,7 +486,7 @@ func (m *Test1) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.Sl) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Sl[iNdEx]) copy(dAtA[i:], m.Sl[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Sl[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Sl[iNdEx]))) i-- dAtA[i] = 0xa } @@ -530,7 +531,7 @@ func (m *Test2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -569,14 +570,14 @@ func (m *Slice2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.F != 0 { - i = encodeVarint(dAtA, i, uint64(m.F)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.F)) i-- dAtA[i] = 0x30 } if len(m.E) > 0 { i -= len(m.E) copy(dAtA[i:], m.E) - i = encodeVarint(dAtA, i, uint64(len(m.E))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.E))) i-- dAtA[i] = 0x2a } @@ -586,7 +587,7 @@ func (m *Slice2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -594,13 +595,13 @@ func (m *Slice2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.C) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.C[iNdEx]) copy(dAtA[i:], m.C[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.C[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.C[iNdEx]))) i-- dAtA[i] = 0x1a } } if m.B != nil { - i = encodeVarint(dAtA, i, uint64(*m.B)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.B)) i-- dAtA[i] = 0x10 } @@ -608,13 +609,13 @@ func (m *Slice2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for k := range m.A { v := m.A[k] baseI := i - i = encodeVarint(dAtA, i, uint64(v)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i = encodeVarint(dAtA, i, uint64(k)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -653,7 +654,7 @@ func (m *Element2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.A != 0 { - i = encodeVarint(dAtA, i, uint64(m.A)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.A)) i-- dAtA[i] = 0x8 } @@ -717,7 +718,7 @@ func (m *Test1) SizeVT() (n int) { if len(m.Sl) > 0 { for _, s := range m.Sl { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -733,7 +734,7 @@ func (m *Test2) SizeVT() (n int) { if len(m.Sl) > 0 { for _, e := range m.Sl { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -750,29 +751,29 @@ func (m *Slice2) SizeVT() (n int) { for k, v := range m.A { _ = k _ = v - mapEntrySize := 1 + sov(uint64(k)) + 1 + sov(uint64(v)) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if m.B != nil { - n += 1 + sov(uint64(*m.B)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.B)) } if len(m.C) > 0 { for _, s := range m.C { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.D != nil { l = m.D.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.E) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.F != 0 { - n += 1 + sov(uint64(m.F)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.F)) } n += len(m.unknownFields) return n @@ -785,7 +786,7 @@ func (m *Element2) SizeVT() (n int) { var l int _ = l if m.A != 0 { - n += 1 + sov(uint64(m.A)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.A)) } n += len(m.unknownFields) return n @@ -799,7 +800,7 @@ func (m *Test1) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -827,7 +828,7 @@ func (m *Test1) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -841,11 +842,11 @@ func (m *Test1) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -854,12 +855,12 @@ func (m *Test1) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -882,7 +883,7 @@ func (m *Test2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -910,7 +911,7 @@ func (m *Test2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -923,11 +924,11 @@ func (m *Test2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -946,12 +947,12 @@ func (m *Test2) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -974,7 +975,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1002,7 +1003,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1015,11 +1016,11 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1034,7 +1035,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1050,7 +1051,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1065,7 +1066,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1079,12 +1080,12 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1101,7 +1102,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1121,7 +1122,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1135,11 +1136,11 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1153,7 +1154,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1166,11 +1167,11 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1189,7 +1190,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1203,11 +1204,11 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1221,7 +1222,7 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { m.F = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1235,12 +1236,12 @@ func (m *Slice2) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1263,7 +1264,7 @@ func (m *Element2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1291,7 +1292,7 @@ func (m *Element2) UnmarshalVT(dAtA []byte) error { m.A = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1305,12 +1306,12 @@ func (m *Element2) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1333,7 +1334,7 @@ func (m *Test1) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1361,7 +1362,7 @@ func (m *Test1) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1375,11 +1376,11 @@ func (m *Test1) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1388,12 +1389,12 @@ func (m *Test1) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1416,7 +1417,7 @@ func (m *Test2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1444,7 +1445,7 @@ func (m *Test2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1457,11 +1458,11 @@ func (m *Test2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1480,12 +1481,12 @@ func (m *Test2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1508,7 +1509,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1536,7 +1537,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1549,11 +1550,11 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1568,7 +1569,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1584,7 +1585,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1599,7 +1600,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1613,12 +1614,12 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { } } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1635,7 +1636,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1655,7 +1656,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1669,11 +1670,11 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1687,7 +1688,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1700,11 +1701,11 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1723,7 +1724,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1737,11 +1738,11 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1755,7 +1756,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { m.F = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1769,12 +1770,12 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1797,7 +1798,7 @@ func (m *Element2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1825,7 +1826,7 @@ func (m *Element2) UnmarshalVTUnsafe(dAtA []byte) error { m.A = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1839,12 +1840,12 @@ func (m *Element2) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/proto2/scalars_vtproto.pb.go b/testproto/proto2/scalars_vtproto.pb.go index 7d390c5..b1462b0 100644 --- a/testproto/proto2/scalars_vtproto.pb.go +++ b/testproto/proto2/scalars_vtproto.pb.go @@ -7,11 +7,11 @@ package proto2 import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" math "math" - bits "math/bits" unsafe "unsafe" ) @@ -1220,7 +1220,7 @@ func (m *DoubleMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) i-- dAtA[i] = 0x22 } @@ -1286,7 +1286,7 @@ func (m *FloatMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f1)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) i-- dAtA[i] = 0x22 } @@ -1349,7 +1349,7 @@ func (m *Int32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -1363,26 +1363,26 @@ func (m *Int32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -1422,7 +1422,7 @@ func (m *Int64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -1436,26 +1436,26 @@ func (m *Int64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -1495,7 +1495,7 @@ func (m *Uint32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -1508,26 +1508,26 @@ func (m *Uint32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -1567,7 +1567,7 @@ func (m *Uint64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -1580,26 +1580,26 @@ func (m *Uint64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -1639,7 +1639,7 @@ func (m *Sint32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += soz(uint64(num)) + pksize2 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize2 j1 := i @@ -1653,27 +1653,27 @@ func (m *Sint32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(x3) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint32(m.RepeatedField[iNdEx]) << 1) ^ uint32((m.RepeatedField[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.OptionalField)<<1)^uint32((*m.OptionalField>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.OptionalField)<<1)^uint32((*m.OptionalField>>31)))) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64((uint32(*m.RequiredField)<<1)^uint32((*m.RequiredField>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.RequiredField)<<1)^uint32((*m.RequiredField>>31)))) i-- dAtA[i] = 0x8 } @@ -1713,7 +1713,7 @@ func (m *Sint64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += soz(uint64(num)) + pksize2 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize2 j1 := i @@ -1727,27 +1727,27 @@ func (m *Sint64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(x3) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint64(m.RepeatedField[iNdEx]) << 1) ^ uint64((m.RepeatedField[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.OptionalField)<<1)^uint64((*m.OptionalField>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.OptionalField)<<1)^uint64((*m.OptionalField>>63)))) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64((uint64(*m.RequiredField)<<1)^uint64((*m.RequiredField>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.RequiredField)<<1)^uint64((*m.RequiredField>>63)))) i-- dAtA[i] = 0x8 } @@ -1789,7 +1789,7 @@ func (m *Fixed32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) i-- dAtA[i] = 0x22 } @@ -1853,7 +1853,7 @@ func (m *Fixed64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) i-- dAtA[i] = 0x22 } @@ -1917,7 +1917,7 @@ func (m *Sfixed32Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) i-- dAtA[i] = 0x22 } @@ -1981,7 +1981,7 @@ func (m *Sfixed64Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) i-- dAtA[i] = 0x22 } @@ -2049,7 +2049,7 @@ func (m *BoolMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField))) i-- dAtA[i] = 0x22 } @@ -2124,7 +2124,7 @@ func (m *StringMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedField[iNdEx]) copy(dAtA[i:], m.RepeatedField[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -2132,7 +2132,7 @@ func (m *StringMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.OptionalField != nil { i -= len(*m.OptionalField) copy(dAtA[i:], *m.OptionalField) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalField))) i-- dAtA[i] = 0x12 } @@ -2141,7 +2141,7 @@ func (m *StringMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } else { i -= len(*m.RequiredField) copy(dAtA[i:], *m.RequiredField) - i = encodeVarint(dAtA, i, uint64(len(*m.RequiredField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.RequiredField))) i-- dAtA[i] = 0xa } @@ -2182,7 +2182,7 @@ func (m *BytesMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedField[iNdEx]) copy(dAtA[i:], m.RepeatedField[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -2190,7 +2190,7 @@ func (m *BytesMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.OptionalField != nil { i -= len(m.OptionalField) copy(dAtA[i:], m.OptionalField) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalField))) i-- dAtA[i] = 0x12 } @@ -2199,7 +2199,7 @@ func (m *BytesMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } else { i -= len(m.RequiredField) copy(dAtA[i:], m.RequiredField) - i = encodeVarint(dAtA, i, uint64(len(m.RequiredField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequiredField))) i-- dAtA[i] = 0xa } @@ -2239,7 +2239,7 @@ func (m *EnumMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -2253,43 +2253,32 @@ func (m *EnumMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *DoubleMessage) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -2326,7 +2315,7 @@ func (m *DoubleMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) i-- dAtA[i] = 0x22 } @@ -2392,7 +2381,7 @@ func (m *FloatMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(f1)) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) i-- dAtA[i] = 0x22 } @@ -2455,7 +2444,7 @@ func (m *Int32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -2469,26 +2458,26 @@ func (m *Int32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -2528,7 +2517,7 @@ func (m *Int64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -2542,26 +2531,26 @@ func (m *Int64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -2601,7 +2590,7 @@ func (m *Uint32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -2614,26 +2603,26 @@ func (m *Uint32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -2673,7 +2662,7 @@ func (m *Uint64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -2686,26 +2675,26 @@ func (m *Uint64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -2745,7 +2734,7 @@ func (m *Sint32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += soz(uint64(num)) + pksize2 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize2 j1 := i @@ -2759,27 +2748,27 @@ func (m *Sint32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(x3) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint32(m.RepeatedField[iNdEx]) << 1) ^ uint32((m.RepeatedField[iNdEx] >> 31)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.OptionalField)<<1)^uint32((*m.OptionalField>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.OptionalField)<<1)^uint32((*m.OptionalField>>31)))) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64((uint32(*m.RequiredField)<<1)^uint32((*m.RequiredField>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.RequiredField)<<1)^uint32((*m.RequiredField>>31)))) i-- dAtA[i] = 0x8 } @@ -2819,7 +2808,7 @@ func (m *Sint64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += soz(uint64(num)) + pksize2 += protohelpers.SizeOfZigzag(uint64(num)) } i -= pksize2 j1 := i @@ -2833,27 +2822,27 @@ func (m *Sint64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(x3) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { x4 := (uint64(m.RepeatedField[iNdEx]) << 1) ^ uint64((m.RepeatedField[iNdEx] >> 63)) - i = encodeVarint(dAtA, i, uint64(x4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(x4)) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.OptionalField)<<1)^uint64((*m.OptionalField>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.OptionalField)<<1)^uint64((*m.OptionalField>>63)))) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64((uint64(*m.RequiredField)<<1)^uint64((*m.RequiredField>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.RequiredField)<<1)^uint64((*m.RequiredField>>63)))) i-- dAtA[i] = 0x8 } @@ -2895,7 +2884,7 @@ func (m *Fixed32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) i-- dAtA[i] = 0x22 } @@ -2959,7 +2948,7 @@ func (m *Fixed64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) i-- dAtA[i] = 0x22 } @@ -3023,7 +3012,7 @@ func (m *Sfixed32Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= 4 binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*4)) i-- dAtA[i] = 0x22 } @@ -3087,7 +3076,7 @@ func (m *Sfixed64Message) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.PackedField[iNdEx])) } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField)*8)) i-- dAtA[i] = 0x22 } @@ -3155,7 +3144,7 @@ func (m *BoolMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.PackedField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PackedField))) i-- dAtA[i] = 0x22 } @@ -3230,7 +3219,7 @@ func (m *StringMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedField[iNdEx]) copy(dAtA[i:], m.RepeatedField[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -3238,7 +3227,7 @@ func (m *StringMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m.OptionalField != nil { i -= len(*m.OptionalField) copy(dAtA[i:], *m.OptionalField) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalField))) i-- dAtA[i] = 0x12 } @@ -3247,7 +3236,7 @@ func (m *StringMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { } else { i -= len(*m.RequiredField) copy(dAtA[i:], *m.RequiredField) - i = encodeVarint(dAtA, i, uint64(len(*m.RequiredField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.RequiredField))) i-- dAtA[i] = 0xa } @@ -3288,7 +3277,7 @@ func (m *BytesMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepeatedField[iNdEx]) copy(dAtA[i:], m.RepeatedField[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepeatedField[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -3296,7 +3285,7 @@ func (m *BytesMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m.OptionalField != nil { i -= len(m.OptionalField) copy(dAtA[i:], m.OptionalField) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalField))) i-- dAtA[i] = 0x12 } @@ -3305,7 +3294,7 @@ func (m *BytesMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { } else { i -= len(m.RequiredField) copy(dAtA[i:], m.RequiredField) - i = encodeVarint(dAtA, i, uint64(len(m.RequiredField))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequiredField))) i-- dAtA[i] = 0xa } @@ -3345,7 +3334,7 @@ func (m *EnumMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PackedField) > 0 { var pksize2 int for _, num := range m.PackedField { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -3359,26 +3348,26 @@ func (m *EnumMessage) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x22 } if len(m.RepeatedField) > 0 { for iNdEx := len(m.RepeatedField) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RepeatedField[iNdEx])) i-- dAtA[i] = 0x18 } } if m.OptionalField != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalField)) i-- dAtA[i] = 0x10 } if m.RequiredField == nil { return 0, fmt.Errorf("proto: required field required_field not set") } else { - i = encodeVarint(dAtA, i, uint64(*m.RequiredField)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.RequiredField)) i-- dAtA[i] = 0x8 } @@ -3401,7 +3390,7 @@ func (m *DoubleMessage) SizeVT() (n int) { n += 9 * len(m.RepeatedField) } if len(m.PackedField) > 0 { - n += 1 + sov(uint64(len(m.PackedField)*8)) + len(m.PackedField)*8 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PackedField)*8)) + len(m.PackedField)*8 } n += len(m.unknownFields) return n @@ -3423,7 +3412,7 @@ func (m *FloatMessage) SizeVT() (n int) { n += 5 * len(m.RepeatedField) } if len(m.PackedField) > 0 { - n += 1 + sov(uint64(len(m.PackedField)*4)) + len(m.PackedField)*4 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PackedField)*4)) + len(m.PackedField)*4 } n += len(m.unknownFields) return n @@ -3436,22 +3425,22 @@ func (m *Int32Message) SizeVT() (n int) { var l int _ = l if m.RequiredField != nil { - n += 1 + sov(uint64(*m.RequiredField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.RequiredField)) } if m.OptionalField != nil { - n += 1 + sov(uint64(*m.OptionalField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalField)) } if len(m.RepeatedField) > 0 { for _, e := range m.RepeatedField { - n += 1 + sov(uint64(e)) + n += 1 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.PackedField) > 0 { l = 0 for _, e := range m.PackedField { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -3464,22 +3453,22 @@ func (m *Int64Message) SizeVT() (n int) { var l int _ = l if m.RequiredField != nil { - n += 1 + sov(uint64(*m.RequiredField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.RequiredField)) } if m.OptionalField != nil { - n += 1 + sov(uint64(*m.OptionalField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalField)) } if len(m.RepeatedField) > 0 { for _, e := range m.RepeatedField { - n += 1 + sov(uint64(e)) + n += 1 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.PackedField) > 0 { l = 0 for _, e := range m.PackedField { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -3492,22 +3481,22 @@ func (m *Uint32Message) SizeVT() (n int) { var l int _ = l if m.RequiredField != nil { - n += 1 + sov(uint64(*m.RequiredField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.RequiredField)) } if m.OptionalField != nil { - n += 1 + sov(uint64(*m.OptionalField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalField)) } if len(m.RepeatedField) > 0 { for _, e := range m.RepeatedField { - n += 1 + sov(uint64(e)) + n += 1 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.PackedField) > 0 { l = 0 for _, e := range m.PackedField { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -3520,22 +3509,22 @@ func (m *Uint64Message) SizeVT() (n int) { var l int _ = l if m.RequiredField != nil { - n += 1 + sov(uint64(*m.RequiredField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.RequiredField)) } if m.OptionalField != nil { - n += 1 + sov(uint64(*m.OptionalField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalField)) } if len(m.RepeatedField) > 0 { for _, e := range m.RepeatedField { - n += 1 + sov(uint64(e)) + n += 1 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.PackedField) > 0 { l = 0 for _, e := range m.PackedField { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -3548,22 +3537,22 @@ func (m *Sint32Message) SizeVT() (n int) { var l int _ = l if m.RequiredField != nil { - n += 1 + soz(uint64(*m.RequiredField)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.RequiredField)) } if m.OptionalField != nil { - n += 1 + soz(uint64(*m.OptionalField)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.OptionalField)) } if len(m.RepeatedField) > 0 { for _, e := range m.RepeatedField { - n += 1 + soz(uint64(e)) + n += 1 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.PackedField) > 0 { l = 0 for _, e := range m.PackedField { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -3576,22 +3565,22 @@ func (m *Sint64Message) SizeVT() (n int) { var l int _ = l if m.RequiredField != nil { - n += 1 + soz(uint64(*m.RequiredField)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.RequiredField)) } if m.OptionalField != nil { - n += 1 + soz(uint64(*m.OptionalField)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.OptionalField)) } if len(m.RepeatedField) > 0 { for _, e := range m.RepeatedField { - n += 1 + soz(uint64(e)) + n += 1 + protohelpers.SizeOfZigzag(uint64(e)) } } if len(m.PackedField) > 0 { l = 0 for _, e := range m.PackedField { - l += soz(uint64(e)) + l += protohelpers.SizeOfZigzag(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -3613,7 +3602,7 @@ func (m *Fixed32Message) SizeVT() (n int) { n += 5 * len(m.RepeatedField) } if len(m.PackedField) > 0 { - n += 1 + sov(uint64(len(m.PackedField)*4)) + len(m.PackedField)*4 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PackedField)*4)) + len(m.PackedField)*4 } n += len(m.unknownFields) return n @@ -3635,7 +3624,7 @@ func (m *Fixed64Message) SizeVT() (n int) { n += 9 * len(m.RepeatedField) } if len(m.PackedField) > 0 { - n += 1 + sov(uint64(len(m.PackedField)*8)) + len(m.PackedField)*8 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PackedField)*8)) + len(m.PackedField)*8 } n += len(m.unknownFields) return n @@ -3657,7 +3646,7 @@ func (m *Sfixed32Message) SizeVT() (n int) { n += 5 * len(m.RepeatedField) } if len(m.PackedField) > 0 { - n += 1 + sov(uint64(len(m.PackedField)*4)) + len(m.PackedField)*4 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PackedField)*4)) + len(m.PackedField)*4 } n += len(m.unknownFields) return n @@ -3679,7 +3668,7 @@ func (m *Sfixed64Message) SizeVT() (n int) { n += 9 * len(m.RepeatedField) } if len(m.PackedField) > 0 { - n += 1 + sov(uint64(len(m.PackedField)*8)) + len(m.PackedField)*8 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PackedField)*8)) + len(m.PackedField)*8 } n += len(m.unknownFields) return n @@ -3701,7 +3690,7 @@ func (m *BoolMessage) SizeVT() (n int) { n += 2 * len(m.RepeatedField) } if len(m.PackedField) > 0 { - n += 1 + sov(uint64(len(m.PackedField))) + len(m.PackedField)*1 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PackedField))) + len(m.PackedField)*1 } n += len(m.unknownFields) return n @@ -3715,16 +3704,16 @@ func (m *StringMessage) SizeVT() (n int) { _ = l if m.RequiredField != nil { l = len(*m.RequiredField) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalField != nil { l = len(*m.OptionalField) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.RepeatedField) > 0 { for _, s := range m.RepeatedField { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -3739,16 +3728,16 @@ func (m *BytesMessage) SizeVT() (n int) { _ = l if m.RequiredField != nil { l = len(m.RequiredField) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalField != nil { l = len(m.OptionalField) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.RepeatedField) > 0 { for _, b := range m.RepeatedField { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -3762,33 +3751,27 @@ func (m *EnumMessage) SizeVT() (n int) { var l int _ = l if m.RequiredField != nil { - n += 1 + sov(uint64(*m.RequiredField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.RequiredField)) } if m.OptionalField != nil { - n += 1 + sov(uint64(*m.OptionalField)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalField)) } if len(m.RepeatedField) > 0 { for _, e := range m.RepeatedField { - n += 1 + sov(uint64(e)) + n += 1 + protohelpers.SizeOfVarint(uint64(e)) } } if len(m.PackedField) > 0 { l = 0 for _, e := range m.PackedField { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *DoubleMessage) UnmarshalVT(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) @@ -3798,7 +3781,7 @@ func (m *DoubleMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3858,7 +3841,7 @@ func (m *DoubleMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3871,11 +3854,11 @@ func (m *DoubleMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3912,7 +3895,7 @@ func (m *DoubleMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3925,11 +3908,11 @@ func (m *DoubleMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3954,12 +3937,12 @@ func (m *DoubleMessage) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3986,7 +3969,7 @@ func (m *FloatMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4046,7 +4029,7 @@ func (m *FloatMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4059,11 +4042,11 @@ func (m *FloatMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4100,7 +4083,7 @@ func (m *FloatMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4113,11 +4096,11 @@ func (m *FloatMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4142,12 +4125,12 @@ func (m *FloatMessage) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4174,7 +4157,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4202,7 +4185,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4223,7 +4206,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4241,7 +4224,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4258,7 +4241,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4271,11 +4254,11 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4295,7 +4278,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4317,7 +4300,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4334,7 +4317,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4347,11 +4330,11 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4371,7 +4354,7 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4390,12 +4373,12 @@ func (m *Int32Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4422,7 +4405,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4450,7 +4433,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4471,7 +4454,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4489,7 +4472,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4506,7 +4489,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4519,11 +4502,11 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4543,7 +4526,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4565,7 +4548,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4582,7 +4565,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4595,11 +4578,11 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4619,7 +4602,7 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4638,12 +4621,12 @@ func (m *Int64Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4670,7 +4653,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4698,7 +4681,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4719,7 +4702,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4737,7 +4720,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4754,7 +4737,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4767,11 +4750,11 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4791,7 +4774,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4813,7 +4796,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4830,7 +4813,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4843,11 +4826,11 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4867,7 +4850,7 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4886,12 +4869,12 @@ func (m *Uint32Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4918,7 +4901,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4946,7 +4929,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4967,7 +4950,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4985,7 +4968,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5002,7 +4985,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5015,11 +4998,11 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5039,7 +5022,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5061,7 +5044,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5078,7 +5061,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5091,11 +5074,11 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5115,7 +5098,7 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5134,12 +5117,12 @@ func (m *Uint64Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5166,7 +5149,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5194,7 +5177,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5216,7 +5199,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5235,7 +5218,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5253,7 +5236,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5266,11 +5249,11 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5290,7 +5273,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5313,7 +5296,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5331,7 +5314,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5344,11 +5327,11 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5368,7 +5351,7 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5388,12 +5371,12 @@ func (m *Sint32Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5420,7 +5403,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5448,7 +5431,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5471,7 +5454,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5491,7 +5474,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5509,7 +5492,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5522,11 +5505,11 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5546,7 +5529,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5569,7 +5552,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5587,7 +5570,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5600,11 +5583,11 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5624,7 +5607,7 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5644,12 +5627,12 @@ func (m *Sint64Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5676,7 +5659,7 @@ func (m *Fixed32Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5733,7 +5716,7 @@ func (m *Fixed32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5746,11 +5729,11 @@ func (m *Fixed32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5785,7 +5768,7 @@ func (m *Fixed32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5798,11 +5781,11 @@ func (m *Fixed32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5826,12 +5809,12 @@ func (m *Fixed32Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5858,7 +5841,7 @@ func (m *Fixed64Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5915,7 +5898,7 @@ func (m *Fixed64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5928,11 +5911,11 @@ func (m *Fixed64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5967,7 +5950,7 @@ func (m *Fixed64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5980,11 +5963,11 @@ func (m *Fixed64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6008,12 +5991,12 @@ func (m *Fixed64Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6040,7 +6023,7 @@ func (m *Sfixed32Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6097,7 +6080,7 @@ func (m *Sfixed32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6110,11 +6093,11 @@ func (m *Sfixed32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6149,7 +6132,7 @@ func (m *Sfixed32Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6162,11 +6145,11 @@ func (m *Sfixed32Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6190,12 +6173,12 @@ func (m *Sfixed32Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6222,7 +6205,7 @@ func (m *Sfixed64Message) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6279,7 +6262,7 @@ func (m *Sfixed64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6292,11 +6275,11 @@ func (m *Sfixed64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6331,7 +6314,7 @@ func (m *Sfixed64Message) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6344,11 +6327,11 @@ func (m *Sfixed64Message) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6372,12 +6355,12 @@ func (m *Sfixed64Message) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6404,7 +6387,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6432,7 +6415,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6454,7 +6437,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6473,7 +6456,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6490,7 +6473,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6503,11 +6486,11 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6521,7 +6504,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6543,7 +6526,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6560,7 +6543,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6573,11 +6556,11 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6591,7 +6574,7 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6610,12 +6593,12 @@ func (m *BoolMessage) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6642,7 +6625,7 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6670,7 +6653,7 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6684,11 +6667,11 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6704,7 +6687,7 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6718,11 +6701,11 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6737,7 +6720,7 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6751,11 +6734,11 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6764,12 +6747,12 @@ func (m *StringMessage) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6796,7 +6779,7 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6824,7 +6807,7 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6837,11 +6820,11 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6859,7 +6842,7 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6872,11 +6855,11 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6893,7 +6876,7 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6906,11 +6889,11 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6920,12 +6903,12 @@ func (m *BytesMessage) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6952,7 +6935,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6980,7 +6963,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7001,7 +6984,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7019,7 +7002,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7036,7 +7019,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7049,11 +7032,11 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7066,7 +7049,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7088,7 +7071,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7105,7 +7088,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7118,11 +7101,11 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7135,7 +7118,7 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7154,12 +7137,12 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7177,92 +7160,6 @@ func (m *EnumMessage) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *DoubleMessage) UnmarshalVTUnsafe(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) @@ -7272,7 +7169,7 @@ func (m *DoubleMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7332,7 +7229,7 @@ func (m *DoubleMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7345,11 +7242,11 @@ func (m *DoubleMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7386,7 +7283,7 @@ func (m *DoubleMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7399,11 +7296,11 @@ func (m *DoubleMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7428,12 +7325,12 @@ func (m *DoubleMessage) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7460,7 +7357,7 @@ func (m *FloatMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7520,7 +7417,7 @@ func (m *FloatMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7533,11 +7430,11 @@ func (m *FloatMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7574,7 +7471,7 @@ func (m *FloatMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7587,11 +7484,11 @@ func (m *FloatMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7616,12 +7513,12 @@ func (m *FloatMessage) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7648,7 +7545,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7676,7 +7573,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7697,7 +7594,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7715,7 +7612,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7732,7 +7629,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7745,11 +7642,11 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7769,7 +7666,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7791,7 +7688,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7808,7 +7705,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7821,11 +7718,11 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7845,7 +7742,7 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7864,12 +7761,12 @@ func (m *Int32Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7896,7 +7793,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7924,7 +7821,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7945,7 +7842,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7963,7 +7860,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7980,7 +7877,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7993,11 +7890,11 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8017,7 +7914,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8039,7 +7936,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8056,7 +7953,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8069,11 +7966,11 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8093,7 +7990,7 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8112,12 +8009,12 @@ func (m *Int64Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8144,7 +8041,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8172,7 +8069,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8193,7 +8090,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8211,7 +8108,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8228,7 +8125,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8241,11 +8138,11 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8265,7 +8162,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8287,7 +8184,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8304,7 +8201,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8317,11 +8214,11 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8341,7 +8238,7 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8360,12 +8257,12 @@ func (m *Uint32Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8392,7 +8289,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8420,7 +8317,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8441,7 +8338,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8459,7 +8356,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8476,7 +8373,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8489,11 +8386,11 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8513,7 +8410,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8535,7 +8432,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8552,7 +8449,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8565,11 +8462,11 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8589,7 +8486,7 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8608,12 +8505,12 @@ func (m *Uint64Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8640,7 +8537,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8668,7 +8565,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8690,7 +8587,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8709,7 +8606,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8727,7 +8624,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8740,11 +8637,11 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8764,7 +8661,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8787,7 +8684,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8805,7 +8702,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8818,11 +8715,11 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8842,7 +8739,7 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8862,12 +8759,12 @@ func (m *Sint32Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8894,7 +8791,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8922,7 +8819,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8945,7 +8842,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8965,7 +8862,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8983,7 +8880,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8996,11 +8893,11 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9020,7 +8917,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9043,7 +8940,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9061,7 +8958,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9074,11 +8971,11 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9098,7 +8995,7 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9118,12 +9015,12 @@ func (m *Sint64Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9150,7 +9047,7 @@ func (m *Fixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9207,7 +9104,7 @@ func (m *Fixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9220,11 +9117,11 @@ func (m *Fixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9259,7 +9156,7 @@ func (m *Fixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9272,11 +9169,11 @@ func (m *Fixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9300,12 +9197,12 @@ func (m *Fixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9332,7 +9229,7 @@ func (m *Fixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9389,7 +9286,7 @@ func (m *Fixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9402,11 +9299,11 @@ func (m *Fixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9441,7 +9338,7 @@ func (m *Fixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9454,11 +9351,11 @@ func (m *Fixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9482,12 +9379,12 @@ func (m *Fixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9514,7 +9411,7 @@ func (m *Sfixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9571,7 +9468,7 @@ func (m *Sfixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9584,11 +9481,11 @@ func (m *Sfixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9623,7 +9520,7 @@ func (m *Sfixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9636,11 +9533,11 @@ func (m *Sfixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9664,12 +9561,12 @@ func (m *Sfixed32Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9696,7 +9593,7 @@ func (m *Sfixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9753,7 +9650,7 @@ func (m *Sfixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9766,11 +9663,11 @@ func (m *Sfixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9805,7 +9702,7 @@ func (m *Sfixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9818,11 +9715,11 @@ func (m *Sfixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9846,12 +9743,12 @@ func (m *Sfixed64Message) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9878,7 +9775,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9906,7 +9803,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9928,7 +9825,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9947,7 +9844,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9964,7 +9861,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9977,11 +9874,11 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -9995,7 +9892,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10017,7 +9914,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10034,7 +9931,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10047,11 +9944,11 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10065,7 +9962,7 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10084,12 +9981,12 @@ func (m *BoolMessage) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10116,7 +10013,7 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10144,7 +10041,7 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10158,11 +10055,11 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10178,7 +10075,7 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10192,11 +10089,11 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10211,7 +10108,7 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10225,11 +10122,11 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10238,12 +10135,12 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10270,7 +10167,7 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10298,7 +10195,7 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10311,11 +10208,11 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10330,7 +10227,7 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10343,11 +10240,11 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10361,7 +10258,7 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10374,11 +10271,11 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10387,12 +10284,12 @@ func (m *BytesMessage) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10419,7 +10316,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10447,7 +10344,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10468,7 +10365,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10486,7 +10383,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10503,7 +10400,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10516,11 +10413,11 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10533,7 +10430,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10555,7 +10452,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10572,7 +10469,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10585,11 +10482,11 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -10602,7 +10499,7 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { var v EnumMessage_Num for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10621,12 +10518,12 @@ func (m *EnumMessage) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/proto3opt/opt_vtproto.pb.go b/testproto/proto3opt/opt_vtproto.pb.go index 7ccb0d7..6d75771 100644 --- a/testproto/proto3opt/opt_vtproto.pb.go +++ b/testproto/proto3opt/opt_vtproto.pb.go @@ -7,11 +7,11 @@ package proto3opt import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" math "math" - bits "math/bits" unsafe "unsafe" ) @@ -198,7 +198,7 @@ func (m *OptionalFieldInProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if m.OptionalEnum != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalEnum)) i-- dAtA[i] = 0x1 i-- @@ -207,14 +207,14 @@ func (m *OptionalFieldInProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) if m.OptionalBytes != nil { i -= len(m.OptionalBytes) copy(dAtA[i:], m.OptionalBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) i-- dAtA[i] = 0x7a } if m.OptionalString != nil { i -= len(*m.OptionalString) copy(dAtA[i:], *m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalString))) i-- dAtA[i] = 0x72 } @@ -265,49 +265,38 @@ func (m *OptionalFieldInProto3) MarshalToSizedBufferVT(dAtA []byte) (int, error) dAtA[i] = 0x3d } if m.OptionalSint64 != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) i-- dAtA[i] = 0x30 } if m.OptionalSint32 != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) i-- dAtA[i] = 0x28 } if m.OptionalUint64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint64)) i-- dAtA[i] = 0x20 } if m.OptionalUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint32)) i-- dAtA[i] = 0x18 } if m.OptionalInt64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt64)) i-- dAtA[i] = 0x10 } if m.OptionalInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt32)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *OptionalFieldInProto3) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -339,7 +328,7 @@ func (m *OptionalFieldInProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, copy(dAtA[i:], m.unknownFields) } if m.OptionalEnum != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalEnum)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalEnum)) i-- dAtA[i] = 0x1 i-- @@ -348,14 +337,14 @@ func (m *OptionalFieldInProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, if m.OptionalBytes != nil { i -= len(m.OptionalBytes) copy(dAtA[i:], m.OptionalBytes) - i = encodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OptionalBytes))) i-- dAtA[i] = 0x7a } if m.OptionalString != nil { i -= len(*m.OptionalString) copy(dAtA[i:], *m.OptionalString) - i = encodeVarint(dAtA, i, uint64(len(*m.OptionalString))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.OptionalString))) i-- dAtA[i] = 0x72 } @@ -406,32 +395,32 @@ func (m *OptionalFieldInProto3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, dAtA[i] = 0x3d } if m.OptionalSint64 != nil { - i = encodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint64(*m.OptionalSint64)<<1)^uint64((*m.OptionalSint64>>63)))) i-- dAtA[i] = 0x30 } if m.OptionalSint32 != nil { - i = encodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(*m.OptionalSint32)<<1)^uint32((*m.OptionalSint32>>31)))) i-- dAtA[i] = 0x28 } if m.OptionalUint64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint64)) i-- dAtA[i] = 0x20 } if m.OptionalUint32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalUint32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalUint32)) i-- dAtA[i] = 0x18 } if m.OptionalInt64 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt64)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt64)) i-- dAtA[i] = 0x10 } if m.OptionalInt32 != nil { - i = encodeVarint(dAtA, i, uint64(*m.OptionalInt32)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.OptionalInt32)) i-- dAtA[i] = 0x8 } @@ -445,22 +434,22 @@ func (m *OptionalFieldInProto3) SizeVT() (n int) { var l int _ = l if m.OptionalInt32 != nil { - n += 1 + sov(uint64(*m.OptionalInt32)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalInt32)) } if m.OptionalInt64 != nil { - n += 1 + sov(uint64(*m.OptionalInt64)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalInt64)) } if m.OptionalUint32 != nil { - n += 1 + sov(uint64(*m.OptionalUint32)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalUint32)) } if m.OptionalUint64 != nil { - n += 1 + sov(uint64(*m.OptionalUint64)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.OptionalUint64)) } if m.OptionalSint32 != nil { - n += 1 + soz(uint64(*m.OptionalSint32)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.OptionalSint32)) } if m.OptionalSint64 != nil { - n += 1 + soz(uint64(*m.OptionalSint64)) + n += 1 + protohelpers.SizeOfZigzag(uint64(*m.OptionalSint64)) } if m.OptionalFixed32 != nil { n += 5 @@ -485,25 +474,19 @@ func (m *OptionalFieldInProto3) SizeVT() (n int) { } if m.OptionalString != nil { l = len(*m.OptionalString) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalBytes != nil { l = len(m.OptionalBytes) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OptionalEnum != nil { - n += 2 + sov(uint64(*m.OptionalEnum)) + n += 2 + protohelpers.SizeOfVarint(uint64(*m.OptionalEnum)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -512,7 +495,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -540,7 +523,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -560,7 +543,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -580,7 +563,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -600,7 +583,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -620,7 +603,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -641,7 +624,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -731,7 +714,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -752,7 +735,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -766,11 +749,11 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -785,7 +768,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -798,11 +781,11 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -819,7 +802,7 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { var v SimpleEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -834,12 +817,12 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { m.OptionalEnum = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -854,92 +837,6 @@ func (m *OptionalFieldInProto3) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -948,7 +845,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -976,7 +873,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -996,7 +893,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1016,7 +913,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1036,7 +933,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1056,7 +953,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1077,7 +974,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1167,7 +1064,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1188,7 +1085,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1202,11 +1099,11 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1221,7 +1118,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1234,11 +1131,11 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1252,7 +1149,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { var v SimpleEnum for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1267,12 +1164,12 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { m.OptionalEnum = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/unsafe/unsafe_vtproto.pb.go b/testproto/unsafe/unsafe_vtproto.pb.go index 9534758..5126407 100644 --- a/testproto/unsafe/unsafe_vtproto.pb.go +++ b/testproto/unsafe/unsafe_vtproto.pb.go @@ -6,10 +6,10 @@ package unsafe import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" unsafe "unsafe" ) @@ -498,14 +498,14 @@ func (m *UnsafeTest_Sub1) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.B) > 0 { i -= len(m.B) copy(dAtA[i:], m.B) - i = encodeVarint(dAtA, i, uint64(len(m.B))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B))) i-- dAtA[i] = 0x12 } if len(m.S) > 0 { i -= len(m.S) copy(dAtA[i:], m.S) - i = encodeVarint(dAtA, i, uint64(len(m.S))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.S))) i-- dAtA[i] = 0xa } @@ -546,7 +546,7 @@ func (m *UnsafeTest_Sub2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.B) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.B[iNdEx]) copy(dAtA[i:], m.B[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -555,7 +555,7 @@ func (m *UnsafeTest_Sub2) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.S) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.S[iNdEx]) copy(dAtA[i:], m.S[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.S[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.S[iNdEx]))) i-- dAtA[i] = 0xa } @@ -599,15 +599,15 @@ func (m *UnsafeTest_Sub3) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -666,7 +666,7 @@ func (m *UnsafeTest_Sub4_S) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.S) copy(dAtA[i:], m.S) - i = encodeVarint(dAtA, i, uint64(len(m.S))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.S))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -680,7 +680,7 @@ func (m *UnsafeTest_Sub4_B) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.B) copy(dAtA[i:], m.B) - i = encodeVarint(dAtA, i, uint64(len(m.B))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -740,7 +740,7 @@ func (m *UnsafeTest_Sub1_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -759,7 +759,7 @@ func (m *UnsafeTest_Sub2_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -778,7 +778,7 @@ func (m *UnsafeTest_Sub3_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -797,23 +797,12 @@ func (m *UnsafeTest_Sub4_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *UnsafeTest_Sub1) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -847,14 +836,14 @@ func (m *UnsafeTest_Sub1) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) if len(m.B) > 0 { i -= len(m.B) copy(dAtA[i:], m.B) - i = encodeVarint(dAtA, i, uint64(len(m.B))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B))) i-- dAtA[i] = 0x12 } if len(m.S) > 0 { i -= len(m.S) copy(dAtA[i:], m.S) - i = encodeVarint(dAtA, i, uint64(len(m.S))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.S))) i-- dAtA[i] = 0xa } @@ -895,7 +884,7 @@ func (m *UnsafeTest_Sub2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) for iNdEx := len(m.B) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.B[iNdEx]) copy(dAtA[i:], m.B[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -904,7 +893,7 @@ func (m *UnsafeTest_Sub2) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) for iNdEx := len(m.S) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.S[iNdEx]) copy(dAtA[i:], m.S[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.S[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.S[iNdEx]))) i-- dAtA[i] = 0xa } @@ -948,15 +937,15 @@ func (m *UnsafeTest_Sub3) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -1020,7 +1009,7 @@ func (m *UnsafeTest_Sub4_S) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro i := len(dAtA) i -= len(m.S) copy(dAtA[i:], m.S) - i = encodeVarint(dAtA, i, uint64(len(m.S))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.S))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1034,7 +1023,7 @@ func (m *UnsafeTest_Sub4_B) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro i := len(dAtA) i -= len(m.B) copy(dAtA[i:], m.B) - i = encodeVarint(dAtA, i, uint64(len(m.B))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.B))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -1113,7 +1102,7 @@ func (m *UnsafeTest_Sub1_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1132,7 +1121,7 @@ func (m *UnsafeTest_Sub2_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -1151,7 +1140,7 @@ func (m *UnsafeTest_Sub3_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -1170,7 +1159,7 @@ func (m *UnsafeTest_Sub4_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -1184,11 +1173,11 @@ func (m *UnsafeTest_Sub1) SizeVT() (n int) { _ = l l = len(m.S) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.B) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1203,13 +1192,13 @@ func (m *UnsafeTest_Sub2) SizeVT() (n int) { if len(m.S) > 0 { for _, s := range m.S { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.B) > 0 { for _, b := range m.B { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1226,9 +1215,9 @@ func (m *UnsafeTest_Sub3) SizeVT() (n int) { for k, v := range m.Foo { _ = k _ = v - l = 1 + len(v) + sov(uint64(len(v))) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + l = 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } n += len(m.unknownFields) @@ -1255,7 +1244,7 @@ func (m *UnsafeTest_Sub4_S) SizeVT() (n int) { var l int _ = l l = len(m.S) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *UnsafeTest_Sub4_B) SizeVT() (n int) { @@ -1265,7 +1254,7 @@ func (m *UnsafeTest_Sub4_B) SizeVT() (n int) { var l int _ = l l = len(m.B) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *UnsafeTest) SizeVT() (n int) { @@ -1289,7 +1278,7 @@ func (m *UnsafeTest_Sub1_) SizeVT() (n int) { _ = l if m.Sub1 != nil { l = m.Sub1.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1301,7 +1290,7 @@ func (m *UnsafeTest_Sub2_) SizeVT() (n int) { _ = l if m.Sub2 != nil { l = m.Sub2.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1313,7 +1302,7 @@ func (m *UnsafeTest_Sub3_) SizeVT() (n int) { _ = l if m.Sub3 != nil { l = m.Sub3.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1325,17 +1314,10 @@ func (m *UnsafeTest_Sub4_) SizeVT() (n int) { _ = l if m.Sub4 != nil { l = m.Sub4.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } - -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1344,7 +1326,7 @@ func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1372,7 +1354,7 @@ func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1386,11 +1368,11 @@ func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1404,7 +1386,7 @@ func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1417,11 +1399,11 @@ func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1433,12 +1415,12 @@ func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1461,7 +1443,7 @@ func (m *UnsafeTest_Sub2) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1489,7 +1471,7 @@ func (m *UnsafeTest_Sub2) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1503,11 +1485,11 @@ func (m *UnsafeTest_Sub2) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1521,7 +1503,7 @@ func (m *UnsafeTest_Sub2) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1534,11 +1516,11 @@ func (m *UnsafeTest_Sub2) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1548,12 +1530,12 @@ func (m *UnsafeTest_Sub2) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1576,7 +1558,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1604,7 +1586,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1617,11 +1599,11 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1636,7 +1618,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1653,7 +1635,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1667,11 +1649,11 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -1682,7 +1664,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1696,11 +1678,11 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postbytesIndex > l { return io.ErrUnexpectedEOF @@ -1710,12 +1692,12 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { iNdEx = postbytesIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1727,12 +1709,12 @@ func (m *UnsafeTest_Sub3) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1755,7 +1737,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1783,7 +1765,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1797,11 +1779,11 @@ func (m *UnsafeTest_Sub4) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1815,7 +1797,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1828,11 +1810,11 @@ func (m *UnsafeTest_Sub4) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1843,12 +1825,12 @@ func (m *UnsafeTest_Sub4) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1871,7 +1853,7 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1899,7 +1881,7 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1912,11 +1894,11 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1940,7 +1922,7 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1953,11 +1935,11 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1981,7 +1963,7 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1994,11 +1976,11 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2022,7 +2004,7 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2035,11 +2017,11 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2058,12 +2040,12 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2078,92 +2060,6 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2172,7 +2068,7 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2200,7 +2096,7 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2214,11 +2110,11 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2232,7 +2128,7 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2245,11 +2141,11 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2258,12 +2154,12 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2286,7 +2182,7 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2314,7 +2210,7 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2328,11 +2224,11 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2346,7 +2242,7 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2359,11 +2255,11 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2372,12 +2268,12 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2400,7 +2296,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2428,7 +2324,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2441,11 +2337,11 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2460,7 +2356,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2477,7 +2373,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2491,11 +2387,11 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -2506,7 +2402,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2520,11 +2416,11 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postbytesIndex > l { return io.ErrUnexpectedEOF @@ -2533,12 +2429,12 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postbytesIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -2550,12 +2446,12 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2578,7 +2474,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2606,7 +2502,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2620,11 +2516,11 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2638,7 +2534,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2651,11 +2547,11 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2665,12 +2561,12 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2693,7 +2589,7 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2721,7 +2617,7 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2734,11 +2630,11 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2762,7 +2658,7 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2775,11 +2671,11 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2803,7 +2699,7 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2816,11 +2712,11 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2844,7 +2740,7 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2857,11 +2753,11 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2880,12 +2776,12 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/testproto/wkt/wkt_vtproto.pb.go b/testproto/wkt/wkt_vtproto.pb.go index 1fb40f8..9d1a84c 100644 --- a/testproto/wkt/wkt_vtproto.pb.go +++ b/testproto/wkt/wkt_vtproto.pb.go @@ -6,6 +6,7 @@ package wkt import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" durationpb1 "github.com/planetscale/vtprotobuf/types/known/durationpb" emptypb1 "github.com/planetscale/vtprotobuf/types/known/emptypb" @@ -23,7 +24,6 @@ import ( timestamppb "google.golang.org/protobuf/types/known/timestamppb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" io "io" - bits "math/bits" ) const ( @@ -168,7 +168,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.NullValue != 0 { - i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NullValue)) i-- dAtA[i] = 0x1 i-- @@ -180,7 +180,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -192,7 +192,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -204,7 +204,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7a } @@ -214,7 +214,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x72 } @@ -224,7 +224,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6a } @@ -234,7 +234,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x62 } @@ -244,7 +244,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } @@ -254,7 +254,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } @@ -264,7 +264,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x4a } @@ -274,7 +274,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x42 } @@ -284,7 +284,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3a } @@ -294,7 +294,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -304,7 +304,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -314,7 +314,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -324,7 +324,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -334,7 +334,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -344,24 +344,13 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *MessageWithWKT) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -393,7 +382,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if m.NullValue != 0 { - i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NullValue)) i-- dAtA[i] = 0x1 i-- @@ -405,7 +394,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -417,7 +406,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -429,7 +418,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7a } @@ -439,7 +428,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x72 } @@ -449,7 +438,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6a } @@ -459,7 +448,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x62 } @@ -469,7 +458,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } @@ -479,7 +468,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } @@ -489,7 +478,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x4a } @@ -499,7 +488,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x42 } @@ -509,7 +498,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3a } @@ -519,7 +508,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -529,7 +518,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -539,7 +528,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -549,7 +538,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -559,7 +548,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -569,7 +558,7 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -584,85 +573,79 @@ func (m *MessageWithWKT) SizeVT() (n int) { _ = l if m.Any != nil { l = (*anypb1.Any)(m.Any).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Duration != nil { l = (*durationpb1.Duration)(m.Duration).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Empty != nil { l = (*emptypb1.Empty)(m.Empty).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.FieldMask != nil { l = (*fieldmaskpb1.FieldMask)(m.FieldMask).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Timestamp != nil { l = (*timestamppb1.Timestamp)(m.Timestamp).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.DoubleValue != nil { l = (*wrapperspb1.DoubleValue)(m.DoubleValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.FloatValue != nil { l = (*wrapperspb1.FloatValue)(m.FloatValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Int64Value != nil { l = (*wrapperspb1.Int64Value)(m.Int64Value).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Uint64Value != nil { l = (*wrapperspb1.UInt64Value)(m.Uint64Value).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Int32Value != nil { l = (*wrapperspb1.Int32Value)(m.Int32Value).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Uint32Value != nil { l = (*wrapperspb1.UInt32Value)(m.Uint32Value).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.BoolValue != nil { l = (*wrapperspb1.BoolValue)(m.BoolValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.StringValue != nil { l = (*wrapperspb1.StringValue)(m.StringValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.BytesValue != nil { l = (*wrapperspb1.BytesValue)(m.BytesValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.StructValue != nil { l = (*structpb1.Struct)(m.StructValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.ValueValue != nil { l = (*structpb1.Value)(m.ValueValue).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.ListvalueValue != nil { l = (*structpb1.ListValue)(m.ListvalueValue).SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.NullValue != 0 { - n += 2 + sov(uint64(m.NullValue)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.NullValue)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -671,7 +654,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -699,7 +682,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -712,11 +695,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -735,7 +718,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -748,11 +731,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -771,7 +754,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -784,11 +767,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -807,7 +790,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -820,11 +803,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -843,7 +826,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -856,11 +839,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -879,7 +862,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -892,11 +875,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -915,7 +898,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -928,11 +911,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -951,7 +934,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -964,11 +947,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -987,7 +970,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1000,11 +983,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1023,7 +1006,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1036,11 +1019,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1059,7 +1042,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1072,11 +1055,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1095,7 +1078,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1108,11 +1091,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1131,7 +1114,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1144,11 +1127,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1167,7 +1150,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1180,11 +1163,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1203,7 +1186,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1216,11 +1199,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1239,7 +1222,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1252,11 +1235,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1275,7 +1258,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1288,11 +1271,11 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1311,7 +1294,7 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { m.NullValue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1325,12 +1308,12 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1345,92 +1328,6 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1439,7 +1336,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1467,7 +1364,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1480,11 +1377,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1503,7 +1400,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1516,11 +1413,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1539,7 +1436,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1552,11 +1449,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1575,7 +1472,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1588,11 +1485,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1611,7 +1508,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1624,11 +1521,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1647,7 +1544,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1660,11 +1557,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1683,7 +1580,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1696,11 +1593,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1719,7 +1616,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1732,11 +1629,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1755,7 +1652,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1768,11 +1665,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1791,7 +1688,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1804,11 +1701,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1827,7 +1724,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1840,11 +1737,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1863,7 +1760,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1876,11 +1773,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1899,7 +1796,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1912,11 +1809,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1935,7 +1832,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1948,11 +1845,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1971,7 +1868,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1984,11 +1881,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2007,7 +1904,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2020,11 +1917,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2043,7 +1940,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2056,11 +1953,11 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2079,7 +1976,7 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { m.NullValue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2093,12 +1990,12 @@ func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/types/known/anypb/any_vtproto.pb.go b/types/known/anypb/any_vtproto.pb.go index aa49968..c851922 100644 --- a/types/known/anypb/any_vtproto.pb.go +++ b/types/known/anypb/any_vtproto.pb.go @@ -6,10 +6,10 @@ package anypb import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" io "io" - bits "math/bits" unsafe "unsafe" ) @@ -80,31 +80,20 @@ func (m *Any) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } if len(m.TypeUrl) > 0 { i -= len(m.TypeUrl) copy(dAtA[i:], m.TypeUrl) - i = encodeVarint(dAtA, i, uint64(len(m.TypeUrl))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TypeUrl))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Any) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -134,14 +123,14 @@ func (m *Any) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } if len(m.TypeUrl) > 0 { i -= len(m.TypeUrl) copy(dAtA[i:], m.TypeUrl) - i = encodeVarint(dAtA, i, uint64(len(m.TypeUrl))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TypeUrl))) i-- dAtA[i] = 0xa } @@ -156,21 +145,15 @@ func (m *Any) SizeVT() (n int) { _ = l l = len(m.TypeUrl) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Value) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Any) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -179,7 +162,7 @@ func (m *Any) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -207,7 +190,7 @@ func (m *Any) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -221,11 +204,11 @@ func (m *Any) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -239,7 +222,7 @@ func (m *Any) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -252,11 +235,11 @@ func (m *Any) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -268,12 +251,12 @@ func (m *Any) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -287,92 +270,6 @@ func (m *Any) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -381,7 +278,7 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -409,7 +306,7 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -423,11 +320,11 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -441,7 +338,7 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -454,11 +351,11 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -467,12 +364,12 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/types/known/durationpb/duration_vtproto.pb.go b/types/known/durationpb/duration_vtproto.pb.go index 349e70f..681ae9f 100644 --- a/types/known/durationpb/duration_vtproto.pb.go +++ b/types/known/durationpb/duration_vtproto.pb.go @@ -6,10 +6,10 @@ package durationpb import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" io "io" - bits "math/bits" ) const ( @@ -73,29 +73,18 @@ func (m *Duration) MarshalToSizedBufferVT(dAtA []byte) (int, error) { var l int _ = l if m.Nanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.Nanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Nanos)) i-- dAtA[i] = 0x10 } if m.Seconds != 0 { - i = encodeVarint(dAtA, i, uint64(m.Seconds)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Seconds)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Duration) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -123,12 +112,12 @@ func (m *Duration) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { var l int _ = l if m.Nanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.Nanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Nanos)) i-- dAtA[i] = 0x10 } if m.Seconds != 0 { - i = encodeVarint(dAtA, i, uint64(m.Seconds)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Seconds)) i-- dAtA[i] = 0x8 } @@ -142,20 +131,14 @@ func (m *Duration) SizeVT() (n int) { var l int _ = l if m.Seconds != 0 { - n += 1 + sov(uint64(m.Seconds)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Seconds)) } if m.Nanos != 0 { - n += 1 + sov(uint64(m.Nanos)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Nanos)) } return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Duration) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -164,7 +147,7 @@ func (m *Duration) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -192,7 +175,7 @@ func (m *Duration) UnmarshalVT(dAtA []byte) error { m.Seconds = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -211,7 +194,7 @@ func (m *Duration) UnmarshalVT(dAtA []byte) error { m.Nanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -225,12 +208,12 @@ func (m *Duration) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -244,92 +227,6 @@ func (m *Duration) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *Duration) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -338,7 +235,7 @@ func (m *Duration) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -366,7 +263,7 @@ func (m *Duration) UnmarshalVTUnsafe(dAtA []byte) error { m.Seconds = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -385,7 +282,7 @@ func (m *Duration) UnmarshalVTUnsafe(dAtA []byte) error { m.Nanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -399,12 +296,12 @@ func (m *Duration) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/types/known/emptypb/empty_vtproto.pb.go b/types/known/emptypb/empty_vtproto.pb.go index 07f7ac7..470c82a 100644 --- a/types/known/emptypb/empty_vtproto.pb.go +++ b/types/known/emptypb/empty_vtproto.pb.go @@ -6,10 +6,10 @@ package emptypb import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" io "io" - bits "math/bits" ) const ( @@ -67,17 +67,6 @@ func (m *Empty) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Empty) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -116,12 +105,6 @@ func (m *Empty) SizeVT() (n int) { return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Empty) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -130,7 +113,7 @@ func (m *Empty) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -153,12 +136,12 @@ func (m *Empty) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -172,92 +155,6 @@ func (m *Empty) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *Empty) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -266,7 +163,7 @@ func (m *Empty) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -289,12 +186,12 @@ func (m *Empty) UnmarshalVTUnsafe(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/types/known/fieldmaskpb/field_mask_vtproto.pb.go b/types/known/fieldmaskpb/field_mask_vtproto.pb.go index 759b021..0faf18d 100644 --- a/types/known/fieldmaskpb/field_mask_vtproto.pb.go +++ b/types/known/fieldmaskpb/field_mask_vtproto.pb.go @@ -6,10 +6,10 @@ package fieldmaskpb import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" io "io" - bits "math/bits" unsafe "unsafe" ) @@ -83,7 +83,7 @@ func (m *FieldMask) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Paths[iNdEx]) copy(dAtA[i:], m.Paths[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Paths[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Paths[iNdEx]))) i-- dAtA[i] = 0xa } @@ -91,17 +91,6 @@ func (m *FieldMask) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *FieldMask) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -132,7 +121,7 @@ func (m *FieldMask) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Paths[iNdEx]) copy(dAtA[i:], m.Paths[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Paths[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Paths[iNdEx]))) i-- dAtA[i] = 0xa } @@ -149,18 +138,12 @@ func (m *FieldMask) SizeVT() (n int) { if len(m.Paths) > 0 { for _, s := range m.Paths { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *FieldMask) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -169,7 +152,7 @@ func (m *FieldMask) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -197,7 +180,7 @@ func (m *FieldMask) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -211,11 +194,11 @@ func (m *FieldMask) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -224,12 +207,12 @@ func (m *FieldMask) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -243,92 +226,6 @@ func (m *FieldMask) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *FieldMask) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -337,7 +234,7 @@ func (m *FieldMask) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -365,7 +262,7 @@ func (m *FieldMask) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -379,11 +276,11 @@ func (m *FieldMask) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -392,12 +289,12 @@ func (m *FieldMask) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go index 8b3e93c..aa35f71 100644 --- a/types/known/structpb/struct_vtproto.pb.go +++ b/types/known/structpb/struct_vtproto.pb.go @@ -7,11 +7,11 @@ package structpb import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" structpb "google.golang.org/protobuf/types/known/structpb" io "io" math "math" - bits "math/bits" unsafe "unsafe" ) @@ -414,15 +414,15 @@ func (m *Struct) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -504,7 +504,7 @@ func (m *Value_NullValue) MarshalToVT(dAtA []byte) (int, error) { func (m *Value_NullValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NullValue)) i-- dAtA[i] = 0x8 return len(dAtA) - i, nil @@ -531,7 +531,7 @@ func (m *Value_StringValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) - i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StringValue))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil @@ -566,7 +566,7 @@ func (m *Value_StructValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -585,7 +585,7 @@ func (m *Value_ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -624,7 +624,7 @@ func (m *ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -632,17 +632,6 @@ func (m *ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Struct) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -678,15 +667,15 @@ func (m *Struct) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -778,7 +767,7 @@ func (m *Value_NullValue) MarshalToVTStrict(dAtA []byte) (int, error) { func (m *Value_NullValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.NullValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NullValue)) i-- dAtA[i] = 0x8 return len(dAtA) - i, nil @@ -805,7 +794,7 @@ func (m *Value_StringValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) - i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StringValue))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil @@ -840,7 +829,7 @@ func (m *Value_StructValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -859,7 +848,7 @@ func (m *Value_ListValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -898,7 +887,7 @@ func (m *ListValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -920,9 +909,9 @@ func (m *Struct) SizeVT() (n int) { if v != nil { l = (*Value)(v).SizeVT() } - l += 1 + sov(uint64(l)) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } return n @@ -957,7 +946,7 @@ func (m *Value_NullValue) SizeVT() (n int) { } var l int _ = l - n += 1 + sov(uint64(m.NullValue)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.NullValue)) return n } func (m *Value_NumberValue) SizeVT() (n int) { @@ -976,7 +965,7 @@ func (m *Value_StringValue) SizeVT() (n int) { var l int _ = l l = len(m.StringValue) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *Value_BoolValue) SizeVT() (n int) { @@ -996,7 +985,7 @@ func (m *Value_StructValue) SizeVT() (n int) { _ = l if m.StructValue != nil { l = (*Struct)(m.StructValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1008,7 +997,7 @@ func (m *Value_ListValue) SizeVT() (n int) { _ = l if m.ListValue != nil { l = (*ListValue)(m.ListValue).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1021,18 +1010,12 @@ func (m *ListValue) SizeVT() (n int) { if len(m.Values) > 0 { for _, e := range m.Values { l = (*Value)(e).SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Struct) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1041,7 +1024,7 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1069,7 +1052,7 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1082,11 +1065,11 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1101,7 +1084,7 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1118,7 +1101,7 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1132,11 +1115,11 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -1147,7 +1130,7 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1160,11 +1143,11 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -1176,12 +1159,12 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1193,12 +1176,12 @@ func (m *Struct) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1220,7 +1203,7 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1248,7 +1231,7 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { var v structpb.NullValue for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1279,7 +1262,7 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1293,11 +1276,11 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1311,7 +1294,7 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1332,7 +1315,7 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1345,11 +1328,11 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1373,7 +1356,7 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1386,11 +1369,11 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1409,12 +1392,12 @@ func (m *Value) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1436,7 +1419,7 @@ func (m *ListValue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1464,7 +1447,7 @@ func (m *ListValue) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1477,11 +1460,11 @@ func (m *ListValue) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1493,12 +1476,12 @@ func (m *ListValue) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1512,92 +1495,6 @@ func (m *ListValue) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1606,7 +1503,7 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1634,7 +1531,7 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1647,11 +1544,11 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1666,7 +1563,7 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1683,7 +1580,7 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1697,11 +1594,11 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -1712,7 +1609,7 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1725,11 +1622,11 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -1741,12 +1638,12 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1758,12 +1655,12 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1785,7 +1682,7 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1813,7 +1710,7 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { var v structpb.NullValue for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1844,7 +1741,7 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1858,11 +1755,11 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1876,7 +1773,7 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1897,7 +1794,7 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1910,11 +1807,11 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1938,7 +1835,7 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1951,11 +1848,11 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1974,12 +1871,12 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2001,7 +1898,7 @@ func (m *ListValue) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2029,7 +1926,7 @@ func (m *ListValue) UnmarshalVTUnsafe(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2042,11 +1939,11 @@ func (m *ListValue) UnmarshalVTUnsafe(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2058,12 +1955,12 @@ func (m *ListValue) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/types/known/timestamppb/timestamp_vtproto.pb.go b/types/known/timestamppb/timestamp_vtproto.pb.go index 231bc65..5c63f30 100644 --- a/types/known/timestamppb/timestamp_vtproto.pb.go +++ b/types/known/timestamppb/timestamp_vtproto.pb.go @@ -6,10 +6,10 @@ package timestamppb import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" - bits "math/bits" ) const ( @@ -73,29 +73,18 @@ func (m *Timestamp) MarshalToSizedBufferVT(dAtA []byte) (int, error) { var l int _ = l if m.Nanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.Nanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Nanos)) i-- dAtA[i] = 0x10 } if m.Seconds != 0 { - i = encodeVarint(dAtA, i, uint64(m.Seconds)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Seconds)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Timestamp) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -123,12 +112,12 @@ func (m *Timestamp) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { var l int _ = l if m.Nanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.Nanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Nanos)) i-- dAtA[i] = 0x10 } if m.Seconds != 0 { - i = encodeVarint(dAtA, i, uint64(m.Seconds)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Seconds)) i-- dAtA[i] = 0x8 } @@ -142,20 +131,14 @@ func (m *Timestamp) SizeVT() (n int) { var l int _ = l if m.Seconds != 0 { - n += 1 + sov(uint64(m.Seconds)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Seconds)) } if m.Nanos != 0 { - n += 1 + sov(uint64(m.Nanos)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Nanos)) } return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Timestamp) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -164,7 +147,7 @@ func (m *Timestamp) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -192,7 +175,7 @@ func (m *Timestamp) UnmarshalVT(dAtA []byte) error { m.Seconds = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -211,7 +194,7 @@ func (m *Timestamp) UnmarshalVT(dAtA []byte) error { m.Nanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -225,12 +208,12 @@ func (m *Timestamp) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -244,92 +227,6 @@ func (m *Timestamp) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *Timestamp) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -338,7 +235,7 @@ func (m *Timestamp) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -366,7 +263,7 @@ func (m *Timestamp) UnmarshalVTUnsafe(dAtA []byte) error { m.Seconds = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -385,7 +282,7 @@ func (m *Timestamp) UnmarshalVTUnsafe(dAtA []byte) error { m.Nanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -399,12 +296,12 @@ func (m *Timestamp) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/types/known/wrapperspb/wrappers_vtproto.pb.go b/types/known/wrapperspb/wrappers_vtproto.pb.go index 8942b43..9a4e4f6 100644 --- a/types/known/wrapperspb/wrappers_vtproto.pb.go +++ b/types/known/wrapperspb/wrappers_vtproto.pb.go @@ -7,11 +7,11 @@ package wrapperspb import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" io "io" math "math" - bits "math/bits" unsafe "unsafe" ) @@ -322,7 +322,7 @@ func (m *Int64Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -356,7 +356,7 @@ func (m *UInt64Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -390,7 +390,7 @@ func (m *Int32Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -424,7 +424,7 @@ func (m *UInt32Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -499,7 +499,7 @@ func (m *StringValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0xa } @@ -535,24 +535,13 @@ func (m *BytesValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *DoubleValue) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -650,7 +639,7 @@ func (m *Int64Value) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -684,7 +673,7 @@ func (m *UInt64Value) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -718,7 +707,7 @@ func (m *Int32Value) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -752,7 +741,7 @@ func (m *UInt32Value) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { var l int _ = l if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } @@ -827,7 +816,7 @@ func (m *StringValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0xa } @@ -863,7 +852,7 @@ func (m *BytesValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0xa } @@ -901,7 +890,7 @@ func (m *Int64Value) SizeVT() (n int) { var l int _ = l if m.Value != 0 { - n += 1 + sov(uint64(m.Value)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Value)) } return n } @@ -913,7 +902,7 @@ func (m *UInt64Value) SizeVT() (n int) { var l int _ = l if m.Value != 0 { - n += 1 + sov(uint64(m.Value)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Value)) } return n } @@ -925,7 +914,7 @@ func (m *Int32Value) SizeVT() (n int) { var l int _ = l if m.Value != 0 { - n += 1 + sov(uint64(m.Value)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Value)) } return n } @@ -937,7 +926,7 @@ func (m *UInt32Value) SizeVT() (n int) { var l int _ = l if m.Value != 0 { - n += 1 + sov(uint64(m.Value)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Value)) } return n } @@ -962,7 +951,7 @@ func (m *StringValue) SizeVT() (n int) { _ = l l = len(m.Value) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -975,17 +964,11 @@ func (m *BytesValue) SizeVT() (n int) { _ = l l = len(m.Value) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *DoubleValue) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -994,7 +977,7 @@ func (m *DoubleValue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1028,12 +1011,12 @@ func (m *DoubleValue) UnmarshalVT(dAtA []byte) error { m.Value = float64(math.Float64frombits(v)) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1055,7 +1038,7 @@ func (m *FloatValue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1089,12 +1072,12 @@ func (m *FloatValue) UnmarshalVT(dAtA []byte) error { m.Value = float32(math.Float32frombits(v)) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1116,7 +1099,7 @@ func (m *Int64Value) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1144,7 +1127,7 @@ func (m *Int64Value) UnmarshalVT(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1158,12 +1141,12 @@ func (m *Int64Value) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1185,7 +1168,7 @@ func (m *UInt64Value) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1213,7 +1196,7 @@ func (m *UInt64Value) UnmarshalVT(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1227,12 +1210,12 @@ func (m *UInt64Value) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1254,7 +1237,7 @@ func (m *Int32Value) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1282,7 +1265,7 @@ func (m *Int32Value) UnmarshalVT(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1296,12 +1279,12 @@ func (m *Int32Value) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1323,7 +1306,7 @@ func (m *UInt32Value) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1351,7 +1334,7 @@ func (m *UInt32Value) UnmarshalVT(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1365,12 +1348,12 @@ func (m *UInt32Value) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1392,7 +1375,7 @@ func (m *BoolValue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1420,7 +1403,7 @@ func (m *BoolValue) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1435,12 +1418,12 @@ func (m *BoolValue) UnmarshalVT(dAtA []byte) error { m.Value = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1462,7 +1445,7 @@ func (m *StringValue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1490,7 +1473,7 @@ func (m *StringValue) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1504,11 +1487,11 @@ func (m *StringValue) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1517,12 +1500,12 @@ func (m *StringValue) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1544,7 +1527,7 @@ func (m *BytesValue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1572,7 +1555,7 @@ func (m *BytesValue) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1585,11 +1568,11 @@ func (m *BytesValue) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1601,12 +1584,12 @@ func (m *BytesValue) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1620,92 +1603,6 @@ func (m *BytesValue) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) - func (m *DoubleValue) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1714,7 +1611,7 @@ func (m *DoubleValue) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1748,12 +1645,12 @@ func (m *DoubleValue) UnmarshalVTUnsafe(dAtA []byte) error { m.Value = float64(math.Float64frombits(v)) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1775,7 +1672,7 @@ func (m *FloatValue) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1809,12 +1706,12 @@ func (m *FloatValue) UnmarshalVTUnsafe(dAtA []byte) error { m.Value = float32(math.Float32frombits(v)) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1836,7 +1733,7 @@ func (m *Int64Value) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1864,7 +1761,7 @@ func (m *Int64Value) UnmarshalVTUnsafe(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1878,12 +1775,12 @@ func (m *Int64Value) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1905,7 +1802,7 @@ func (m *UInt64Value) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1933,7 +1830,7 @@ func (m *UInt64Value) UnmarshalVTUnsafe(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1947,12 +1844,12 @@ func (m *UInt64Value) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1974,7 +1871,7 @@ func (m *Int32Value) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2002,7 +1899,7 @@ func (m *Int32Value) UnmarshalVTUnsafe(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2016,12 +1913,12 @@ func (m *Int32Value) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2043,7 +1940,7 @@ func (m *UInt32Value) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2071,7 +1968,7 @@ func (m *UInt32Value) UnmarshalVTUnsafe(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2085,12 +1982,12 @@ func (m *UInt32Value) UnmarshalVTUnsafe(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2112,7 +2009,7 @@ func (m *BoolValue) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2140,7 +2037,7 @@ func (m *BoolValue) UnmarshalVTUnsafe(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2155,12 +2052,12 @@ func (m *BoolValue) UnmarshalVTUnsafe(dAtA []byte) error { m.Value = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2182,7 +2079,7 @@ func (m *StringValue) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2210,7 +2107,7 @@ func (m *StringValue) UnmarshalVTUnsafe(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2224,11 +2121,11 @@ func (m *StringValue) UnmarshalVTUnsafe(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2237,12 +2134,12 @@ func (m *StringValue) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2264,7 +2161,7 @@ func (m *BytesValue) UnmarshalVTUnsafe(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2292,7 +2189,7 @@ func (m *BytesValue) UnmarshalVTUnsafe(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2305,11 +2202,11 @@ func (m *BytesValue) UnmarshalVTUnsafe(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2318,12 +2215,12 @@ func (m *BytesValue) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF From 7e34ec78c9de9e3b0a09cd95b1ee88da58dfff9b Mon Sep 17 00:00:00 2001 From: Corentin Dupret Date: Wed, 6 Dec 2023 10:55:52 +0100 Subject: [PATCH 10/18] Remove `--go-vtproto_opt=wkt=false` option --- cmd/protoc-gen-go-vtproto/main.go | 1 - generator/generatedfile.go | 6 +++--- generator/generator.go | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/protoc-gen-go-vtproto/main.go b/cmd/protoc-gen-go-vtproto/main.go index 6f9209e..e0ebb60 100644 --- a/cmd/protoc-gen-go-vtproto/main.go +++ b/cmd/protoc-gen-go-vtproto/main.go @@ -25,7 +25,6 @@ func main() { cfg.Poolable = make(generator.ObjectSet) f.Var(&cfg.Poolable, "pool", "use memory pooling for this object") f.BoolVar(&cfg.Wrap, "wrap", false, "generate wrapper types") - f.BoolVar(&cfg.WellKnownTypes, "wkt", true, "generate optimized code for well-known types") f.StringVar(&features, "features", "all", "list of features to generate (separated by '+')") protogen.Options{ParamFunc: f.Set}.Run(func(plugin *protogen.Plugin) error { diff --git a/generator/generatedfile.go b/generator/generatedfile.go index d578082..6716608 100644 --- a/generator/generatedfile.go +++ b/generator/generatedfile.go @@ -158,7 +158,7 @@ var wellKnownFields = map[protoreflect.FullName]protogen.GoIdent{ } func (p *GeneratedFile) IsWellKnownType(message *protogen.Message) bool { - if message == nil || !p.Config.WellKnownTypes { + if message == nil { return false } _, ok := wellKnownTypes[message.Desc.FullName()] @@ -166,7 +166,7 @@ func (p *GeneratedFile) IsWellKnownType(message *protogen.Message) bool { } func (p *GeneratedFile) WellKnownFieldMap(field *protogen.Field) protogen.GoIdent { - if field == nil || !p.Config.WellKnownTypes { + if field == nil { return protogen.GoIdent{} } res, ff := wellKnownFields[field.Desc.FullName()] @@ -180,7 +180,7 @@ func (p *GeneratedFile) WellKnownFieldMap(field *protogen.Field) protogen.GoIden } func (p *GeneratedFile) WellKnownTypeMap(message *protogen.Message) protogen.GoIdent { - if message == nil || !p.Config.WellKnownTypes { + if message == nil { return protogen.GoIdent{} } res := wellKnownTypes[message.Desc.FullName()] diff --git a/generator/generator.go b/generator/generator.go index 63abe3f..2263880 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -39,7 +39,6 @@ func (o ObjectSet) Set(s string) error { type Config struct { Poolable ObjectSet Wrap bool - WellKnownTypes bool AllowEmpty bool } From 42f444aa0d91dda907de04ca241c38def78ce8fd Mon Sep 17 00:00:00 2001 From: Corentin Dupret Date: Wed, 6 Dec 2023 16:40:05 +0100 Subject: [PATCH 11/18] Remove `wkt` option from README --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 63afeeb..4a3784f 100644 --- a/README.md +++ b/README.md @@ -113,11 +113,9 @@ The following features can be generated: 7. (Optional) Switch your RPC framework to use the optimized helpers (see following sections) -## Well-known types +## `vtprotobuf` package and well-known types -By default, `vtprotobuf` will detect ProtoBuf [well-known types](https://protobuf.dev/reference/protobuf/google.protobuf/) embedded in your own Messages and generate optimized code to marshal and unmarshal them. - -In order to access the optimized code for these types, your `_vtproto.pb.go` files will have a dependency on this Go package. If this is not acceptable, you can disable well-known types with `--go-vtproto_opt=wkt=false`. +Your generated `_vtproto.pb.go` files will have a dependency on this Go package to access some helper functions as well as the optimized code for ProtoBuf [well-known types](https://protobuf.dev/reference/protobuf/google.protobuf/). `vtprotobuf` will detect these types embedded in your own Messages and generate optimized code to marshal and unmarshal them. ## Using the optimized code with RPC frameworks From 1c89824a84f456879ab50a3a72fe25b9d0d6b7f9 Mon Sep 17 00:00:00 2001 From: Corentin Dupret Date: Mon, 11 Dec 2023 18:13:25 +0100 Subject: [PATCH 12/18] Downgrade `grpc` to version 1.58.2 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7932ad4..91c37af 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/stretchr/testify v1.8.4 - google.golang.org/grpc v1.59.0 + google.golang.org/grpc v1.58.2 google.golang.org/protobuf v1.31.0 ) diff --git a/go.sum b/go.sum index 87d8531..378518b 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= From c64fedf703f4dbf614e670548c9d0cd69cae6d90 Mon Sep 17 00:00:00 2001 From: John Howard Date: Tue, 12 Dec 2023 09:42:57 -0800 Subject: [PATCH 13/18] Add ability to include a build tag This enables conditional compiling. This is particularly useful for shared protobufs for common APIs, where not all consumers have the same preferences around build size vs benefits of vtprotobuf. This allows the consumer of the library to chose whether vtprotobuf is used, rather than only the producer of the library. Additionally, it provides guidance to use `vtprotobuf` as the tag. The hope is that if multiple libraries do this, a user can just set that tag instead of `-tags=envoy_vt,enable_vtprotobuf_prometheus,vtproto_k8s` or something like that. See https://github.com/envoyproxy/envoy/pull/31172, where this will be utilized (I think). --- Makefile | 10 ++++++++++ README.md | 14 ++++++++++++-- cmd/protoc-gen-go-vtproto/main.go | 1 + generator/generator.go | 12 +++++++++--- testproto/buildtag/empty/empty_vtproto.pb.go | 19 +++++++++++++++++++ 5 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 testproto/buildtag/empty/empty_vtproto.pb.go diff --git a/Makefile b/Makefile index c524dbb..41c524d 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,16 @@ gen-testproto: get-grpc-testproto gen-wkt-testproto install testproto/proto2/scalars.proto \ testproto/unsafe/unsafe.proto \ || exit 1; + $(PROTOBUF_ROOT)/src/protoc \ + --proto_path=testproto \ + --proto_path=include \ + --go_out=. --plugin protoc-gen-go="${GOBIN}/protoc-gen-go" \ + --go-vtproto_opt=paths=source_relative \ + --go-vtproto_opt=buildTag=vtprotobuf \ + --go-vtproto_out=allow-empty=true:./testproto/buildtag --plugin protoc-gen-go-vtproto="${GOBIN}/protoc-gen-go-vtproto" \ + -I$(PROTOBUF_ROOT)/src \ + testproto/empty/empty.proto \ + || exit 1; get-grpc-testproto: install $(PROTOBUF_ROOT)/src/protoc \ diff --git a/README.md b/README.md index 4a3784f..5222f04 100644 --- a/README.md +++ b/README.md @@ -108,10 +108,20 @@ The following features can be generated: --go-vtproto_opt=pool=vitess.io/vitess/go/vt/proto/query.Row \ --go-vtproto_opt=pool=vitess.io/vitess/go/vt/proto/binlogdata.VStreamRowsResponse \ ``` +6. (Optional) if you want to selectively compile the generate `vtprotobuf` files, the `--vtproto_opt=buildTag=` can be used. -6. Compile the `.proto` files in your project. You should see `_vtproto.pb.go` files next to the `.pb.go` and `_grpc.pb.go` files that were already being generated. + When using this option, the generated code will only be compiled in if a build tag is provided. -7. (Optional) Switch your RPC framework to use the optimized helpers (see following sections) + It is recommended, but not required, to use `vtprotobuf` as the build tag if this is desired, especially if your project is imported by others. + This will reduce the number of build tags a user will need to configure if they are importing multiple libraries following this pattern. + + When using this option, it is strongly recommended to make your code compile with and without the build tag. + This can be done with type assertions before using `vtprotobuf` generated methods. + The `grpc.Codec{}` object (discussed below) shows an example. + +7. Compile the `.proto` files in your project. You should see `_vtproto.pb.go` files next to the `.pb.go` and `_grpc.pb.go` files that were already being generated. + +8. (Optional) Switch your RPC framework to use the optimized helpers (see following sections) ## `vtprotobuf` package and well-known types diff --git a/cmd/protoc-gen-go-vtproto/main.go b/cmd/protoc-gen-go-vtproto/main.go index e0ebb60..3a317d3 100644 --- a/cmd/protoc-gen-go-vtproto/main.go +++ b/cmd/protoc-gen-go-vtproto/main.go @@ -26,6 +26,7 @@ func main() { f.Var(&cfg.Poolable, "pool", "use memory pooling for this object") f.BoolVar(&cfg.Wrap, "wrap", false, "generate wrapper types") f.StringVar(&features, "features", "all", "list of features to generate (separated by '+')") + f.StringVar(&cfg.BuildTag, "buildTag", "", "the go:build tag to set on generated files") protogen.Options{ParamFunc: f.Set}.Run(func(plugin *protogen.Plugin) error { gen, err := generator.NewGenerator(plugin, strings.Split(features, "+"), &cfg) diff --git a/generator/generator.go b/generator/generator.go index 2263880..416232e 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -37,9 +37,10 @@ func (o ObjectSet) Set(s string) error { } type Config struct { - Poolable ObjectSet - Wrap bool - AllowEmpty bool + Poolable ObjectSet + Wrap bool + AllowEmpty bool + BuildTag string } type Generator struct { @@ -97,6 +98,11 @@ func (gen *Generator) generateFile(gf *protogen.GeneratedFile, file *protogen.Fi LocalPackages: gen.local, } + if p.Config.BuildTag != "" { + // Support both forms of tags for maximum compatibility + p.P("//go:build ", p.Config.BuildTag) + p.P("// +build ", p.Config.BuildTag) + } p.P("// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.") if bi, ok := debug.ReadBuildInfo(); ok { p.P("// protoc-gen-go-vtproto version: ", bi.Main.Version) diff --git a/testproto/buildtag/empty/empty_vtproto.pb.go b/testproto/buildtag/empty/empty_vtproto.pb.go new file mode 100644 index 0000000..7a3e0d5 --- /dev/null +++ b/testproto/buildtag/empty/empty_vtproto.pb.go @@ -0,0 +1,19 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: (devel) +// source: empty/empty.proto + +package empty + +import ( + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) From 3aa65402c7547eb9985007ffb9864b0a800cb735 Mon Sep 17 00:00:00 2001 From: Evgeniy Fedotov Date: Thu, 14 Dec 2023 02:42:58 +0300 Subject: [PATCH 14/18] Fix: Append check on IsMap in pool message generation --- features/pool/pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/pool/pool.go b/features/pool/pool.go index 1148b70..004386b 100644 --- a/features/pool/pool.go +++ b/features/pool/pool.go @@ -75,7 +75,7 @@ func (p *pool) message(message *protogen.Message) { } else { switch field.Desc.Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: - if p.ShouldPool(field.Message) { + if !field.Desc.IsMap() && p.ShouldPool(field.Message) { p.P(`m.`, fieldName, `.ReturnToVTPool()`) } case protoreflect.BytesKind: From c47c2bc1dff9ed28b324d5519c7f1a31cae0309c Mon Sep 17 00:00:00 2001 From: Maheesha Perera Date: Sun, 17 Dec 2023 14:40:04 +1100 Subject: [PATCH 15/18] Add test case to demonstrate panic when UnmarshalUnsafe is called with an empty string map value or empty oneof string field --- testproto/unsafe/unsafe.pb.go | 141 ++++- testproto/unsafe/unsafe.proto | 5 + testproto/unsafe/unsafe_test.go | 75 ++- testproto/unsafe/unsafe_vtproto.pb.go | 762 +++++++++++++++++++++++++- 4 files changed, 907 insertions(+), 76 deletions(-) diff --git a/testproto/unsafe/unsafe.pb.go b/testproto/unsafe/unsafe.pb.go index 4b5a345..f7a86f9 100644 --- a/testproto/unsafe/unsafe.pb.go +++ b/testproto/unsafe/unsafe.pb.go @@ -31,6 +31,7 @@ type UnsafeTest struct { // *UnsafeTest_Sub2_ // *UnsafeTest_Sub3_ // *UnsafeTest_Sub4_ + // *UnsafeTest_Sub5_ Sub isUnsafeTest_Sub `protobuf_oneof:"sub"` } @@ -101,6 +102,13 @@ func (x *UnsafeTest) GetSub4() *UnsafeTest_Sub4 { return nil } +func (x *UnsafeTest) GetSub5() *UnsafeTest_Sub5 { + if x, ok := x.GetSub().(*UnsafeTest_Sub5_); ok { + return x.Sub5 + } + return nil +} + type isUnsafeTest_Sub interface { isUnsafeTest_Sub() } @@ -121,6 +129,10 @@ type UnsafeTest_Sub4_ struct { Sub4 *UnsafeTest_Sub4 `protobuf:"bytes,4,opt,name=sub4,proto3,oneof"` } +type UnsafeTest_Sub5_ struct { + Sub5 *UnsafeTest_Sub5 `protobuf:"bytes,5,opt,name=sub5,proto3,oneof"` +} + func (*UnsafeTest_Sub1_) isUnsafeTest_Sub() {} func (*UnsafeTest_Sub2_) isUnsafeTest_Sub() {} @@ -129,6 +141,8 @@ func (*UnsafeTest_Sub3_) isUnsafeTest_Sub() {} func (*UnsafeTest_Sub4_) isUnsafeTest_Sub() {} +func (*UnsafeTest_Sub5_) isUnsafeTest_Sub() {} + type UnsafeTest_Sub1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -367,11 +381,58 @@ func (*UnsafeTest_Sub4_S) isUnsafeTest_Sub4_Foo() {} func (*UnsafeTest_Sub4_B) isUnsafeTest_Sub4_Foo() {} +type UnsafeTest_Sub5 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Foo map[string]string `protobuf:"bytes,1,rep,name=foo,proto3" json:"foo,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *UnsafeTest_Sub5) Reset() { + *x = UnsafeTest_Sub5{} + if protoimpl.UnsafeEnabled { + mi := &file_unsafe_unsafe_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnsafeTest_Sub5) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnsafeTest_Sub5) ProtoMessage() {} + +func (x *UnsafeTest_Sub5) ProtoReflect() protoreflect.Message { + mi := &file_unsafe_unsafe_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnsafeTest_Sub5.ProtoReflect.Descriptor instead. +func (*UnsafeTest_Sub5) Descriptor() ([]byte, []int) { + return file_unsafe_unsafe_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *UnsafeTest_Sub5) GetFoo() map[string]string { + if x != nil { + return x.Foo + } + return nil +} + var File_unsafe_unsafe_proto protoreflect.FileDescriptor var file_unsafe_unsafe_proto_rawDesc = []byte{ 0x0a, 0x13, 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x2f, 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x03, 0x0a, 0x0a, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x04, 0x0a, 0x0a, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x54, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x75, 0x62, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x31, 0x48, 0x00, 0x52, 0x04, 0x73, 0x75, 0x62, 0x31, 0x12, 0x26, 0x0a, 0x04, @@ -382,23 +443,32 @@ var file_unsafe_unsafe_proto_rawDesc = []byte{ 0x53, 0x75, 0x62, 0x33, 0x48, 0x00, 0x52, 0x04, 0x73, 0x75, 0x62, 0x33, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x75, 0x62, 0x34, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x34, 0x48, 0x00, 0x52, 0x04, - 0x73, 0x75, 0x62, 0x34, 0x1a, 0x22, 0x0a, 0x04, 0x53, 0x75, 0x62, 0x31, 0x12, 0x0c, 0x0a, 0x01, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x62, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x62, 0x1a, 0x22, 0x0a, 0x04, 0x53, 0x75, 0x62, 0x32, - 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x01, 0x73, 0x12, 0x0c, - 0x0a, 0x01, 0x62, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x01, 0x62, 0x1a, 0x6b, 0x0a, 0x04, - 0x53, 0x75, 0x62, 0x33, 0x12, 0x2b, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x53, - 0x75, 0x62, 0x33, 0x2e, 0x46, 0x6f, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x66, 0x6f, - 0x6f, 0x1a, 0x36, 0x0a, 0x08, 0x46, 0x6f, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x2d, 0x0a, 0x04, 0x53, 0x75, 0x62, - 0x34, 0x12, 0x0e, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x01, - 0x73, 0x12, 0x0e, 0x0a, 0x01, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x01, - 0x62, 0x42, 0x05, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x42, - 0x12, 0x5a, 0x10, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, 0x6e, 0x73, - 0x61, 0x66, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x75, 0x62, 0x34, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x75, 0x62, 0x35, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2e, + 0x53, 0x75, 0x62, 0x35, 0x48, 0x00, 0x52, 0x04, 0x73, 0x75, 0x62, 0x35, 0x1a, 0x22, 0x0a, 0x04, + 0x53, 0x75, 0x62, 0x31, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x62, + 0x1a, 0x22, 0x0a, 0x04, 0x53, 0x75, 0x62, 0x32, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x62, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x01, 0x62, 0x1a, 0x6b, 0x0a, 0x04, 0x53, 0x75, 0x62, 0x33, 0x12, 0x2b, 0x0a, 0x03, + 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x55, 0x6e, 0x73, 0x61, + 0x66, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x33, 0x2e, 0x46, 0x6f, 0x6f, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x1a, 0x36, 0x0a, 0x08, 0x46, 0x6f, 0x6f, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x2d, 0x0a, 0x04, 0x53, 0x75, 0x62, 0x34, 0x12, 0x0e, 0x0a, 0x01, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x01, 0x73, 0x12, 0x0e, 0x0a, 0x01, 0x62, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x01, 0x62, 0x42, 0x05, 0x0a, 0x03, 0x66, 0x6f, 0x6f, + 0x1a, 0x6b, 0x0a, 0x04, 0x53, 0x75, 0x62, 0x35, 0x12, 0x2b, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x54, 0x65, + 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x35, 0x2e, 0x46, 0x6f, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x1a, 0x36, 0x0a, 0x08, 0x46, 0x6f, 0x6f, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x05, 0x0a, + 0x03, 0x73, 0x75, 0x62, 0x42, 0x12, 0x5a, 0x10, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -413,26 +483,30 @@ func file_unsafe_unsafe_proto_rawDescGZIP() []byte { return file_unsafe_unsafe_proto_rawDescData } -var file_unsafe_unsafe_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_unsafe_unsafe_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_unsafe_unsafe_proto_goTypes = []interface{}{ (*UnsafeTest)(nil), // 0: UnsafeTest (*UnsafeTest_Sub1)(nil), // 1: UnsafeTest.Sub1 (*UnsafeTest_Sub2)(nil), // 2: UnsafeTest.Sub2 (*UnsafeTest_Sub3)(nil), // 3: UnsafeTest.Sub3 (*UnsafeTest_Sub4)(nil), // 4: UnsafeTest.Sub4 - nil, // 5: UnsafeTest.Sub3.FooEntry + (*UnsafeTest_Sub5)(nil), // 5: UnsafeTest.Sub5 + nil, // 6: UnsafeTest.Sub3.FooEntry + nil, // 7: UnsafeTest.Sub5.FooEntry } var file_unsafe_unsafe_proto_depIdxs = []int32{ 1, // 0: UnsafeTest.sub1:type_name -> UnsafeTest.Sub1 2, // 1: UnsafeTest.sub2:type_name -> UnsafeTest.Sub2 3, // 2: UnsafeTest.sub3:type_name -> UnsafeTest.Sub3 4, // 3: UnsafeTest.sub4:type_name -> UnsafeTest.Sub4 - 5, // 4: UnsafeTest.Sub3.foo:type_name -> UnsafeTest.Sub3.FooEntry - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 5, // 4: UnsafeTest.sub5:type_name -> UnsafeTest.Sub5 + 6, // 5: UnsafeTest.Sub3.foo:type_name -> UnsafeTest.Sub3.FooEntry + 7, // 6: UnsafeTest.Sub5.foo:type_name -> UnsafeTest.Sub5.FooEntry + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_unsafe_unsafe_proto_init() } @@ -501,12 +575,25 @@ func file_unsafe_unsafe_proto_init() { return nil } } + file_unsafe_unsafe_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnsafeTest_Sub5); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_unsafe_unsafe_proto_msgTypes[0].OneofWrappers = []interface{}{ (*UnsafeTest_Sub1_)(nil), (*UnsafeTest_Sub2_)(nil), (*UnsafeTest_Sub3_)(nil), (*UnsafeTest_Sub4_)(nil), + (*UnsafeTest_Sub5_)(nil), } file_unsafe_unsafe_proto_msgTypes[4].OneofWrappers = []interface{}{ (*UnsafeTest_Sub4_S)(nil), @@ -518,7 +605,7 @@ func file_unsafe_unsafe_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_unsafe_unsafe_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/testproto/unsafe/unsafe.proto b/testproto/unsafe/unsafe.proto index 3150189..59e5e0e 100644 --- a/testproto/unsafe/unsafe.proto +++ b/testproto/unsafe/unsafe.proto @@ -23,10 +23,15 @@ message UnsafeTest { } } + message Sub5 { + map foo = 1; + } + oneof sub { Sub1 sub1 = 1; Sub2 sub2 = 2; Sub3 sub3 = 3; Sub4 sub4 = 4; + Sub5 sub5 = 5; } } diff --git a/testproto/unsafe/unsafe_test.go b/testproto/unsafe/unsafe_test.go index 179faed..2329c8e 100644 --- a/testproto/unsafe/unsafe_test.go +++ b/testproto/unsafe/unsafe_test.go @@ -94,7 +94,7 @@ func Test_UnmarshalVTUnsafe(t *testing.T) { assertBytesAreOriginal(t, (t2Unsafe.Sub).(*UnsafeTest_Sub2_).Sub2.B[i], true, originalData2) } - // map field + // map[string]bytes field t3Orig := &UnsafeTest{ Sub: &UnsafeTest_Sub3_{ Sub3: &UnsafeTest_Sub3{ @@ -122,27 +122,32 @@ func Test_UnmarshalVTUnsafe(t *testing.T) { } // oneof field - t4OrigS := &UnsafeTest{ - Sub: &UnsafeTest_Sub4_{ - Sub4: &UnsafeTest_Sub4{ - Foo: &UnsafeTest_Sub4_S{ - S: testString, + for _, stringVal := range []string{ + testString, + "", + } { + t4OrigS := &UnsafeTest{ + Sub: &UnsafeTest_Sub4_{ + Sub4: &UnsafeTest_Sub4{ + Foo: &UnsafeTest_Sub4_S{ + S: stringVal, + }, }, }, - }, + } + originalData4S, err := t4OrigS.MarshalVT() + require.NoError(t, err) + + t4SafeS := &UnsafeTest{} + require.NoError(t, t4SafeS.UnmarshalVT(originalData4S)) + assert.Equal(t, (t4OrigS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, (t4SafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S) + assertStringIsOriginal(t, (t4SafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, false, originalData4S) + + t4UnsafeS := &UnsafeTest{} + require.NoError(t, t4UnsafeS.UnmarshalVTUnsafe(originalData4S)) + assert.Equal(t, (t4OrigS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, (t4UnsafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S) + assertStringIsOriginal(t, (t4UnsafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, true, originalData4S) } - originalData4S, err := t4OrigS.MarshalVT() - require.NoError(t, err) - - t4SafeS := &UnsafeTest{} - require.NoError(t, t4SafeS.UnmarshalVT(originalData4S)) - assert.Equal(t, (t4OrigS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, (t4SafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S) - assertStringIsOriginal(t, (t4SafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, false, originalData4S) - - t4UnsafeS := &UnsafeTest{} - require.NoError(t, t4UnsafeS.UnmarshalVTUnsafe(originalData4S)) - assert.Equal(t, (t4OrigS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, (t4UnsafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S) - assertStringIsOriginal(t, (t4UnsafeS.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_S).S, true, originalData4S) t4OrigB := &UnsafeTest{ Sub: &UnsafeTest_Sub4_{ @@ -165,4 +170,36 @@ func Test_UnmarshalVTUnsafe(t *testing.T) { require.NoError(t, t4UnsafeB.UnmarshalVTUnsafe(originalData4B)) assert.Equal(t, (t4OrigB.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_B).B, (t4UnsafeB.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_B).B) assertBytesAreOriginal(t, (t4UnsafeB.Sub).(*UnsafeTest_Sub4_).Sub4.Foo.(*UnsafeTest_Sub4_B).B, true, originalData4B) + + // map[string]string field + for _, stringVal := range []string{ + testString, + "", + } { + t5Orig := &UnsafeTest{ + Sub: &UnsafeTest_Sub5_{ + Sub5: &UnsafeTest_Sub5{ + Foo: map[string]string{testString: stringVal}, + }, + }, + } + originalData5, err := t5Orig.MarshalVT() + require.NoError(t, err) + + t5Safe := &UnsafeTest{} + require.NoError(t, t5Safe.UnmarshalVT(originalData5)) + assert.Equal(t, (t5Orig.Sub).(*UnsafeTest_Sub5_).Sub5.Foo, (t5Safe.Sub).(*UnsafeTest_Sub5_).Sub5.Foo) + for k, v := range (t5Safe.Sub).(*UnsafeTest_Sub5_).Sub5.Foo { + assertStringIsOriginal(t, k, false, originalData5) + assertStringIsOriginal(t, v, false, originalData5) + } + + t5Unsafe := &UnsafeTest{} + require.NoError(t, t5Unsafe.UnmarshalVTUnsafe(originalData5)) + assert.Equal(t, (t5Orig.Sub).(*UnsafeTest_Sub5_).Sub5.Foo, (t5Unsafe.Sub).(*UnsafeTest_Sub5_).Sub5.Foo) + for k, v := range (t5Unsafe.Sub).(*UnsafeTest_Sub5_).Sub5.Foo { + assertStringIsOriginal(t, k, true, originalData5) + assertStringIsOriginal(t, v, true, originalData5) + } + } } diff --git a/testproto/unsafe/unsafe_vtproto.pb.go b/testproto/unsafe/unsafe_vtproto.pb.go index 5126407..5b87df2 100644 --- a/testproto/unsafe/unsafe_vtproto.pb.go +++ b/testproto/unsafe/unsafe_vtproto.pb.go @@ -138,6 +138,29 @@ func (m *UnsafeTest_Sub4_B) CloneVT() isUnsafeTest_Sub4_Foo { return r } +func (m *UnsafeTest_Sub5) CloneVT() *UnsafeTest_Sub5 { + if m == nil { + return (*UnsafeTest_Sub5)(nil) + } + r := new(UnsafeTest_Sub5) + if rhs := m.Foo; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.Foo = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UnsafeTest_Sub5) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *UnsafeTest) CloneVT() *UnsafeTest { if m == nil { return (*UnsafeTest)(nil) @@ -193,6 +216,15 @@ func (m *UnsafeTest_Sub4_) CloneVT() isUnsafeTest_Sub { return r } +func (m *UnsafeTest_Sub5_) CloneVT() isUnsafeTest_Sub { + if m == nil { + return (*UnsafeTest_Sub5_)(nil) + } + r := new(UnsafeTest_Sub5_) + r.Sub5 = m.Sub5.CloneVT() + return r +} + func (this *UnsafeTest_Sub1) EqualVT(that *UnsafeTest_Sub1) bool { if this == that { return true @@ -339,6 +371,34 @@ func (this *UnsafeTest_Sub4_B) EqualVT(thatIface isUnsafeTest_Sub4_Foo) bool { return true } +func (this *UnsafeTest_Sub5) EqualVT(that *UnsafeTest_Sub5) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Foo) != len(that.Foo) { + return false + } + for i, vx := range this.Foo { + vy, ok := that.Foo[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UnsafeTest_Sub5) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UnsafeTest_Sub5) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *UnsafeTest) EqualVT(that *UnsafeTest) bool { if this == that { return true @@ -465,6 +525,31 @@ func (this *UnsafeTest_Sub4_) EqualVT(thatIface isUnsafeTest_Sub) bool { return true } +func (this *UnsafeTest_Sub5_) EqualVT(thatIface isUnsafeTest_Sub) bool { + that, ok := thatIface.(*UnsafeTest_Sub5_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Sub5, that.Sub5; p != q { + if p == nil { + p = &UnsafeTest_Sub5{} + } + if q == nil { + q = &UnsafeTest_Sub5{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + func (m *UnsafeTest_Sub1) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -685,6 +770,58 @@ func (m *UnsafeTest_Sub4_B) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x12 return len(dAtA) - i, nil } +func (m *UnsafeTest_Sub5) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UnsafeTest_Sub5) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UnsafeTest_Sub5) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Foo) > 0 { + for k := range m.Foo { + v := m.Foo[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *UnsafeTest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -803,6 +940,25 @@ func (m *UnsafeTest_Sub4_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } +func (m *UnsafeTest_Sub5_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UnsafeTest_Sub5_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Sub5 != nil { + size, err := m.Sub5.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} func (m *UnsafeTest_Sub1) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -1028,6 +1184,58 @@ func (m *UnsafeTest_Sub4_B) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro dAtA[i] = 0x12 return len(dAtA) - i, nil } +func (m *UnsafeTest_Sub5) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UnsafeTest_Sub5) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *UnsafeTest_Sub5) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Foo) > 0 { + for k := range m.Foo { + v := m.Foo[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *UnsafeTest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -1058,6 +1266,13 @@ func (m *UnsafeTest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if msg, ok := m.Sub.(*UnsafeTest_Sub5_); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } if msg, ok := m.Sub.(*UnsafeTest_Sub4_); ok { size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { @@ -1165,6 +1380,25 @@ func (m *UnsafeTest_Sub4_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error } return len(dAtA) - i, nil } +func (m *UnsafeTest_Sub5_) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *UnsafeTest_Sub5_) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Sub5 != nil { + size, err := m.Sub5.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} func (m *UnsafeTest_Sub1) SizeVT() (n int) { if m == nil { return 0 @@ -1257,6 +1491,24 @@ func (m *UnsafeTest_Sub4_B) SizeVT() (n int) { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } +func (m *UnsafeTest_Sub5) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Foo) > 0 { + for k, v := range m.Foo { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + func (m *UnsafeTest) SizeVT() (n int) { if m == nil { return 0 @@ -1318,6 +1570,18 @@ func (m *UnsafeTest_Sub4_) SizeVT() (n int) { } return n } +func (m *UnsafeTest_Sub5_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sub5 != nil { + l = m.Sub5.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} func (m *UnsafeTest_Sub1) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1845,7 +2109,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { +func (m *UnsafeTest_Sub5) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1868,15 +2132,15 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UnsafeTest: wiretype end group for non-group") + return fmt.Errorf("proto: UnsafeTest_Sub5: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UnsafeTest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UnsafeTest_Sub5: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sub1", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Foo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1903,33 +2167,211 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if oneof, ok := m.Sub.(*UnsafeTest_Sub1_); ok { - if err := oneof.Sub1.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - v := &UnsafeTest_Sub1{} - if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sub = &UnsafeTest_Sub1_{Sub1: v} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sub2", wireType) + if m.Foo == nil { + m.Foo = make(map[string]string) } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Foo[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UnsafeTest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnsafeTest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sub1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Sub.(*UnsafeTest_Sub1_); ok { + if err := oneof.Sub1.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UnsafeTest_Sub1{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sub = &UnsafeTest_Sub1_{Sub1: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sub2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2038,6 +2480,47 @@ func (m *UnsafeTest) UnmarshalVT(dAtA []byte) error { m.Sub = &UnsafeTest_Sub4_{Sub4: v} } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sub5", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Sub.(*UnsafeTest_Sub5_); ok { + if err := oneof.Sub5.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UnsafeTest_Sub5{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sub = &UnsafeTest_Sub5_{Sub5: v} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -2581,6 +3064,184 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } +func (m *UnsafeTest_Sub5) UnmarshalVTUnsafe(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UnsafeTest_Sub5: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnsafeTest_Sub5: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Foo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Foo == nil { + m.Foo = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Foo[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2774,6 +3435,47 @@ func (m *UnsafeTest) UnmarshalVTUnsafe(dAtA []byte) error { m.Sub = &UnsafeTest_Sub4_{Sub4: v} } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sub5", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Sub.(*UnsafeTest_Sub5_); ok { + if err := oneof.Sub5.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UnsafeTest_Sub5{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sub = &UnsafeTest_Sub5_{Sub5: v} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) From bcde995f02ab586fe436f3655f5a1fe789277261 Mon Sep 17 00:00:00 2001 From: Maheesha Perera Date: Wed, 27 Dec 2023 01:28:23 +1100 Subject: [PATCH 16/18] fix: handle zero-length strings in unsafe unmarshalling and update test logic to suit --- features/unmarshal/unmarshal.go | 12 +++++++++++- testproto/unsafe/unsafe_test.go | 10 ++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/features/unmarshal/unmarshal.go b/features/unmarshal/unmarshal.go index 2b8bc91..32beeb5 100644 --- a/features/unmarshal/unmarshal.go +++ b/features/unmarshal/unmarshal.go @@ -194,7 +194,11 @@ func (p *unmarshal) mapField(varName string, field *protogen.Field) { p.P(`return `, p.Ident("io", `ErrUnexpectedEOF`)) p.P(`}`) if p.unsafe { + p.P(`if intStringLen`, varName, ` == 0 {`) + p.P(varName, ` = `, p.Ident("unsafe", `String`), `(nil, intStringLen`, varName, `)`) + p.P(`} else {`) p.P(varName, ` = `, p.Ident("unsafe", `String`), `(&dAtA[iNdEx], intStringLen`, varName, `)`) + p.P(`}`) } else { p.P(varName, ` = `, "string", `(dAtA[iNdEx:postStringIndex`, varName, `])`) } @@ -420,7 +424,13 @@ func (p *unmarshal) fieldItem(field *protogen.Field, fieldname string, message * p.P(`}`) str := "string(dAtA[iNdEx:postIndex])" if p.unsafe { - str = p.Ident("unsafe", `String`) + `(&dAtA[iNdEx], intStringLen)` + str = "stringValue" + p.P(`var stringValue string`) + p.P(`if intStringLen == 0 {`) + p.P(`stringValue = `, p.Ident("unsafe", `String`), `(nil, intStringLen)`) + p.P(`} else {`) + p.P(`stringValue = `, p.Ident("unsafe", `String`), `(&dAtA[iNdEx], intStringLen)`) + p.P(`}`) } if oneof { p.P(`m.`, fieldname, ` = &`, field.GoIdent, `{`, field.GoName, ": ", str, `}`) diff --git a/testproto/unsafe/unsafe_test.go b/testproto/unsafe/unsafe_test.go index 2329c8e..066e04d 100644 --- a/testproto/unsafe/unsafe_test.go +++ b/testproto/unsafe/unsafe_test.go @@ -14,11 +14,17 @@ import ( // collector doesn't move memory. To provide guarantee that this test works, consider using // https://pkg.go.dev/runtime#Pinner when upgrading Go to >= 1.21. func assertStringIsOriginal(t *testing.T, s string, belongs bool, originalData []byte) { + start := uintptr(unsafe.Pointer(unsafe.StringData(s))) + // empty string has no underlying array, compare pointer to nil + if len(s) == 0 { + assert.Equal(t, uintptr(unsafe.Pointer(nil)), start) + return + } + end := start + uintptr(len(s)) - 1 + originalStart := uintptr(unsafe.Pointer(unsafe.SliceData(originalData))) originalEnd := originalStart + uintptr(len(originalData)) - 1 - start := uintptr(unsafe.Pointer(unsafe.StringData(s))) - end := start + uintptr(len(s)) - 1 assert.Equal(t, belongs, start >= originalStart && start < originalEnd) assert.Equal(t, belongs, end > originalStart && end <= originalEnd) } From be9232580f9722bb8755efc9ee2506bccda97a80 Mon Sep 17 00:00:00 2001 From: Maheesha Perera Date: Wed, 27 Dec 2023 01:29:08 +1100 Subject: [PATCH 17/18] Regenerate pb.go files --- .../conformance/conformance_vtproto.pb.go | 96 +++++++++++-- .../test_messages_proto2_vtproto.pb.go | 130 +++++++++++++++--- .../test_messages_proto3_vtproto.pb.go | 98 +++++++++++-- testproto/pool/pool_vtproto.pb.go | 8 +- testproto/pool/pool_with_oneof_vtproto.pb.go | 8 +- .../pool/pool_with_slice_reuse_vtproto.pb.go | 24 +++- testproto/proto2/scalars_vtproto.pb.go | 24 +++- testproto/proto3opt/opt_vtproto.pb.go | 8 +- testproto/unsafe/unsafe_vtproto.pb.go | 42 +++++- types/known/anypb/any_vtproto.pb.go | 8 +- .../fieldmaskpb/field_mask_vtproto.pb.go | 8 +- types/known/structpb/struct_vtproto.pb.go | 14 +- types/known/wrapperspb/wrappers_vtproto.pb.go | 8 +- 13 files changed, 412 insertions(+), 64 deletions(-) diff --git a/conformance/internal/conformance/conformance_vtproto.pb.go b/conformance/internal/conformance/conformance_vtproto.pb.go index 1d7e0c7..64187dd 100644 --- a/conformance/internal/conformance/conformance_vtproto.pb.go +++ b/conformance/internal/conformance/conformance_vtproto.pb.go @@ -2373,7 +2373,13 @@ func (m *FailureSet) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Failure = append(m.Failure, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Failure = append(m.Failure, stringValue) iNdEx = postIndex default: iNdEx = preIndex @@ -2488,7 +2494,13 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Payload = &ConformanceRequest_JsonPayload{JsonPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Payload = &ConformanceRequest_JsonPayload{JsonPayload: stringValue} iNdEx = postIndex case 3: if wireType != 0 { @@ -2539,7 +2551,13 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MessageType = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.MessageType = stringValue iNdEx = postIndex case 5: if wireType != 0 { @@ -2626,7 +2644,13 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Payload = &ConformanceRequest_JspbPayload{JspbPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Payload = &ConformanceRequest_JspbPayload{JspbPayload: stringValue} iNdEx = postIndex case 8: if wireType != 2 { @@ -2658,7 +2682,13 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Payload = &ConformanceRequest_TextPayload{TextPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Payload = &ConformanceRequest_TextPayload{TextPayload: stringValue} iNdEx = postIndex case 9: if wireType != 0 { @@ -2761,7 +2791,13 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &ConformanceResponse_ParseError{ParseError: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_ParseError{ParseError: stringValue} iNdEx = postIndex case 2: if wireType != 2 { @@ -2793,7 +2829,13 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &ConformanceResponse_RuntimeError{RuntimeError: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_RuntimeError{RuntimeError: stringValue} iNdEx = postIndex case 3: if wireType != 2 { @@ -2857,7 +2899,13 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &ConformanceResponse_JsonPayload{JsonPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_JsonPayload{JsonPayload: stringValue} iNdEx = postIndex case 5: if wireType != 2 { @@ -2889,7 +2937,13 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &ConformanceResponse_Skipped{Skipped: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_Skipped{Skipped: stringValue} iNdEx = postIndex case 6: if wireType != 2 { @@ -2921,7 +2975,13 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &ConformanceResponse_SerializeError{SerializeError: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_SerializeError{SerializeError: stringValue} iNdEx = postIndex case 7: if wireType != 2 { @@ -2953,7 +3013,13 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &ConformanceResponse_JspbPayload{JspbPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_JspbPayload{JspbPayload: stringValue} iNdEx = postIndex case 8: if wireType != 2 { @@ -2985,7 +3051,13 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &ConformanceResponse_TextPayload{TextPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_TextPayload{TextPayload: stringValue} iNdEx = postIndex default: iNdEx = preIndex diff --git a/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go index 88f5f11..7512401 100644 --- a/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go @@ -14990,7 +14990,13 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVTUnsafe(dAtA if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.Str = &s iNdEx = postIndex default: @@ -15357,7 +15363,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalString = &s iNdEx = postIndex case 15: @@ -15533,7 +15545,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalStringPiece = &s iNdEx = postIndex case 25: @@ -15566,7 +15584,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalCord = &s iNdEx = postIndex case 27: @@ -16481,7 +16505,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepeatedString = append(m.RepeatedString, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedString = append(m.RepeatedString, stringValue) iNdEx = postIndex case 45: if wireType != 2 { @@ -16750,7 +16780,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepeatedStringPiece = append(m.RepeatedStringPiece, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedStringPiece = append(m.RepeatedStringPiece, stringValue) iNdEx = postIndex case 55: if wireType != 2 { @@ -16782,7 +16818,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepeatedCord = append(m.RepeatedCord, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedCord = append(m.RepeatedCord, stringValue) iNdEx = postIndex case 56: if wireType != 2 { @@ -18080,7 +18122,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 @@ -18109,7 +18155,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } - mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + if intStringLenmapvalue == 0 { + mapvalue = unsafe.String(nil, intStringLenmapvalue) + } else { + mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + } iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex @@ -18207,7 +18257,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapbyteLen uint64 @@ -18334,7 +18388,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int @@ -18463,7 +18521,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int @@ -18592,7 +18654,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { @@ -18705,7 +18771,11 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { @@ -20660,7 +20730,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OneofField = &TestAllTypesProto2_OneofString{OneofString: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OneofField = &TestAllTypesProto2_OneofString{OneofString: stringValue} iNdEx = postIndex case 114: if wireType != 2 { @@ -21057,7 +21133,13 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.DefaultString = &s iNdEx = postIndex case 255: @@ -21702,7 +21784,13 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalString = &s iNdEx = postIndex case 1003: @@ -22059,7 +22147,13 @@ func (m *OneStringProto2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.Data = &s iNdEx = postIndex default: diff --git a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go index 5618fb5..fe05b29 100644 --- a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go @@ -15225,7 +15225,13 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OptionalString = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OptionalString = stringValue iNdEx = postIndex case 15: if wireType != 2 { @@ -15417,7 +15423,13 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OptionalStringPiece = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OptionalStringPiece = stringValue iNdEx = postIndex case 25: if wireType != 2 { @@ -15449,7 +15461,13 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OptionalCord = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OptionalCord = stringValue iNdEx = postIndex case 27: if wireType != 2 { @@ -16363,7 +16381,13 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepeatedString = append(m.RepeatedString, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedString = append(m.RepeatedString, stringValue) iNdEx = postIndex case 45: if wireType != 2 { @@ -16632,7 +16656,13 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepeatedStringPiece = append(m.RepeatedStringPiece, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedStringPiece = append(m.RepeatedStringPiece, stringValue) iNdEx = postIndex case 55: if wireType != 2 { @@ -16664,7 +16694,13 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepeatedCord = append(m.RepeatedCord, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedCord = append(m.RepeatedCord, stringValue) iNdEx = postIndex case 56: if wireType != 2 { @@ -17962,7 +17998,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 @@ -17991,7 +18031,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } - mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + if intStringLenmapvalue == 0 { + mapvalue = unsafe.String(nil, intStringLenmapvalue) + } else { + mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + } iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex @@ -18089,7 +18133,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapbyteLen uint64 @@ -18216,7 +18264,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int @@ -18345,7 +18397,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int @@ -18474,7 +18530,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { @@ -18587,7 +18647,11 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { @@ -20542,7 +20606,13 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OneofField = &TestAllTypesProto3_OneofString{OneofString: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OneofField = &TestAllTypesProto3_OneofString{OneofString: stringValue} iNdEx = postIndex case 114: if wireType != 2 { diff --git a/testproto/pool/pool_vtproto.pb.go b/testproto/pool/pool_vtproto.pb.go index 63dab38..bc5fe52 100644 --- a/testproto/pool/pool_vtproto.pb.go +++ b/testproto/pool/pool_vtproto.pb.go @@ -645,7 +645,13 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Foo1 = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Foo1 = stringValue iNdEx = postIndex case 2: if wireType != 0 { diff --git a/testproto/pool/pool_with_oneof_vtproto.pb.go b/testproto/pool/pool_with_oneof_vtproto.pb.go index 90a6a0d..7c3b18b 100644 --- a/testproto/pool/pool_with_oneof_vtproto.pb.go +++ b/testproto/pool/pool_with_oneof_vtproto.pb.go @@ -1797,7 +1797,13 @@ func (m *OneofTest_Test2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.B = append(m.B, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.B = append(m.B, stringValue) iNdEx = postIndex default: iNdEx = preIndex diff --git a/testproto/pool/pool_with_slice_reuse_vtproto.pb.go b/testproto/pool/pool_with_slice_reuse_vtproto.pb.go index 5d285f5..82f34ee 100644 --- a/testproto/pool/pool_with_slice_reuse_vtproto.pb.go +++ b/testproto/pool/pool_with_slice_reuse_vtproto.pb.go @@ -1385,7 +1385,13 @@ func (m *Test1) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sl = append(m.Sl, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Sl = append(m.Sl, stringValue) iNdEx = postIndex default: iNdEx = preIndex @@ -1679,7 +1685,13 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.C = append(m.C, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.C = append(m.C, stringValue) iNdEx = postIndex case 4: if wireType != 2 { @@ -1747,7 +1759,13 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.E = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.E = stringValue iNdEx = postIndex case 6: if wireType != 0 { diff --git a/testproto/proto2/scalars_vtproto.pb.go b/testproto/proto2/scalars_vtproto.pb.go index b1462b0..15e6804 100644 --- a/testproto/proto2/scalars_vtproto.pb.go +++ b/testproto/proto2/scalars_vtproto.pb.go @@ -10064,7 +10064,13 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.RequiredField = &s iNdEx = postIndex hasFields[0] |= uint64(0x00000001) @@ -10098,7 +10104,13 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalField = &s iNdEx = postIndex case 3: @@ -10131,7 +10143,13 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepeatedField = append(m.RepeatedField, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedField = append(m.RepeatedField, stringValue) iNdEx = postIndex default: iNdEx = preIndex diff --git a/testproto/proto3opt/opt_vtproto.pb.go b/testproto/proto3opt/opt_vtproto.pb.go index 6d75771..7445ceb 100644 --- a/testproto/proto3opt/opt_vtproto.pb.go +++ b/testproto/proto3opt/opt_vtproto.pb.go @@ -1108,7 +1108,13 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalString = &s iNdEx = postIndex case 15: diff --git a/testproto/unsafe/unsafe_vtproto.pb.go b/testproto/unsafe/unsafe_vtproto.pb.go index 5b87df2..c6d12e0 100644 --- a/testproto/unsafe/unsafe_vtproto.pb.go +++ b/testproto/unsafe/unsafe_vtproto.pb.go @@ -2602,7 +2602,13 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.S = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.S = stringValue iNdEx = postIndex case 2: if wireType != 2 { @@ -2716,7 +2722,13 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.S = append(m.S, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.S = append(m.S, stringValue) iNdEx = postIndex case 2: if wireType != 2 { @@ -2879,7 +2891,11 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapbyteLen uint64 @@ -3008,7 +3024,13 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Foo = &UnsafeTest_Sub4_S{S: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Foo = &UnsafeTest_Sub4_S{S: stringValue} iNdEx = postIndex case 2: if wireType != 2 { @@ -3172,7 +3194,11 @@ func (m *UnsafeTest_Sub5) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 @@ -3201,7 +3227,11 @@ func (m *UnsafeTest_Sub5) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } - mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + if intStringLenmapvalue == 0 { + mapvalue = unsafe.String(nil, intStringLenmapvalue) + } else { + mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + } iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex diff --git a/types/known/anypb/any_vtproto.pb.go b/types/known/anypb/any_vtproto.pb.go index c851922..467bef1 100644 --- a/types/known/anypb/any_vtproto.pb.go +++ b/types/known/anypb/any_vtproto.pb.go @@ -329,7 +329,13 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TypeUrl = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.TypeUrl = stringValue iNdEx = postIndex case 2: if wireType != 2 { diff --git a/types/known/fieldmaskpb/field_mask_vtproto.pb.go b/types/known/fieldmaskpb/field_mask_vtproto.pb.go index 0faf18d..e1c75ea 100644 --- a/types/known/fieldmaskpb/field_mask_vtproto.pb.go +++ b/types/known/fieldmaskpb/field_mask_vtproto.pb.go @@ -285,7 +285,13 @@ func (m *FieldMask) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Paths = append(m.Paths, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Paths = append(m.Paths, stringValue) iNdEx = postIndex default: iNdEx = preIndex diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go index aa35f71..1865d0d 100644 --- a/types/known/structpb/struct_vtproto.pb.go +++ b/types/known/structpb/struct_vtproto.pb.go @@ -1603,7 +1603,11 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = unsafe.String(nil, intStringLenmapkey) + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int @@ -1764,7 +1768,13 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Kind = &structpb.Value_StringValue{StringValue: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Kind = &structpb.Value_StringValue{StringValue: stringValue} iNdEx = postIndex case 4: if wireType != 0 { diff --git a/types/known/wrapperspb/wrappers_vtproto.pb.go b/types/known/wrapperspb/wrappers_vtproto.pb.go index 9a4e4f6..f4ad9e5 100644 --- a/types/known/wrapperspb/wrappers_vtproto.pb.go +++ b/types/known/wrapperspb/wrappers_vtproto.pb.go @@ -2130,7 +2130,13 @@ func (m *StringValue) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen == 0 { + stringValue = unsafe.String(nil, intStringLen) + } else { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Value = stringValue iNdEx = postIndex default: iNdEx = preIndex From 7e7e2ecde303038d8aa03f4c1f9985a5094c2f8b Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Mon, 29 Jan 2024 11:27:15 +0100 Subject: [PATCH 18/18] unmarshal: fix length checks for unsafe marshalling Signed-off-by: Vicent Marti --- .../conformance/conformance_vtproto.pb.go | 48 ++++----------- .../test_messages_proto2_vtproto.pb.go | 58 ++++++------------- .../test_messages_proto3_vtproto.pb.go | 42 +++++--------- features/unmarshal/unmarshal.go | 6 +- testproto/pool/pool_vtproto.pb.go | 4 +- testproto/pool/pool_with_oneof_vtproto.pb.go | 4 +- .../pool/pool_with_slice_reuse_vtproto.pb.go | 12 +--- testproto/proto2/scalars_vtproto.pb.go | 12 +--- testproto/proto3opt/opt_vtproto.pb.go | 4 +- testproto/unsafe/unsafe_vtproto.pb.go | 18 ++---- types/known/anypb/any_vtproto.pb.go | 4 +- .../fieldmaskpb/field_mask_vtproto.pb.go | 4 +- types/known/structpb/struct_vtproto.pb.go | 6 +- types/known/wrapperspb/wrappers_vtproto.pb.go | 4 +- 14 files changed, 66 insertions(+), 160 deletions(-) diff --git a/conformance/internal/conformance/conformance_vtproto.pb.go b/conformance/internal/conformance/conformance_vtproto.pb.go index 64187dd..26232f3 100644 --- a/conformance/internal/conformance/conformance_vtproto.pb.go +++ b/conformance/internal/conformance/conformance_vtproto.pb.go @@ -2374,9 +2374,7 @@ func (m *FailureSet) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Failure = append(m.Failure, stringValue) @@ -2495,9 +2493,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Payload = &ConformanceRequest_JsonPayload{JsonPayload: stringValue} @@ -2552,9 +2548,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.MessageType = stringValue @@ -2645,9 +2639,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Payload = &ConformanceRequest_JspbPayload{JspbPayload: stringValue} @@ -2683,9 +2675,7 @@ func (m *ConformanceRequest) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Payload = &ConformanceRequest_TextPayload{TextPayload: stringValue} @@ -2792,9 +2782,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Result = &ConformanceResponse_ParseError{ParseError: stringValue} @@ -2830,9 +2818,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Result = &ConformanceResponse_RuntimeError{RuntimeError: stringValue} @@ -2900,9 +2886,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Result = &ConformanceResponse_JsonPayload{JsonPayload: stringValue} @@ -2938,9 +2922,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Result = &ConformanceResponse_Skipped{Skipped: stringValue} @@ -2976,9 +2958,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Result = &ConformanceResponse_SerializeError{SerializeError: stringValue} @@ -3014,9 +2994,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Result = &ConformanceResponse_JspbPayload{JspbPayload: stringValue} @@ -3052,9 +3030,7 @@ func (m *ConformanceResponse) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Result = &ConformanceResponse_TextPayload{TextPayload: stringValue} diff --git a/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go index 7512401..afc122f 100644 --- a/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go @@ -14991,9 +14991,7 @@ func (m *TestAllTypesProto2_MessageSetCorrectExtension1) UnmarshalVTUnsafe(dAtA return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -15364,9 +15362,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -15546,9 +15542,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -15585,9 +15579,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -16506,9 +16498,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.RepeatedString = append(m.RepeatedString, stringValue) @@ -16781,9 +16771,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.RepeatedStringPiece = append(m.RepeatedStringPiece, stringValue) @@ -16819,9 +16807,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.RepeatedCord = append(m.RepeatedCord, stringValue) @@ -18123,7 +18109,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18156,7 +18142,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapvalue == 0 { - mapvalue = unsafe.String(nil, intStringLenmapvalue) + mapvalue = "" } else { mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) } @@ -18258,7 +18244,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18389,7 +18375,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18522,7 +18508,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18655,7 +18641,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18772,7 +18758,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -20731,9 +20717,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.OneofField = &TestAllTypesProto2_OneofString{OneofString: stringValue} @@ -21134,9 +21118,7 @@ func (m *TestAllTypesProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -21785,9 +21767,7 @@ func (m *UnknownToTestAllTypes) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -22148,9 +22128,7 @@ func (m *OneStringProto2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue diff --git a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go index fe05b29..7de867e 100644 --- a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go @@ -15226,9 +15226,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.OptionalString = stringValue @@ -15424,9 +15422,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.OptionalStringPiece = stringValue @@ -15462,9 +15458,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.OptionalCord = stringValue @@ -16382,9 +16376,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.RepeatedString = append(m.RepeatedString, stringValue) @@ -16657,9 +16649,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.RepeatedStringPiece = append(m.RepeatedStringPiece, stringValue) @@ -16695,9 +16685,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.RepeatedCord = append(m.RepeatedCord, stringValue) @@ -17999,7 +17987,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18032,7 +18020,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapvalue == 0 { - mapvalue = unsafe.String(nil, intStringLenmapvalue) + mapvalue = "" } else { mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) } @@ -18134,7 +18122,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18265,7 +18253,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18398,7 +18386,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18531,7 +18519,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -18648,7 +18636,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -20607,9 +20595,7 @@ func (m *TestAllTypesProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.OneofField = &TestAllTypesProto3_OneofString{OneofString: stringValue} diff --git a/features/unmarshal/unmarshal.go b/features/unmarshal/unmarshal.go index 32beeb5..79e929b 100644 --- a/features/unmarshal/unmarshal.go +++ b/features/unmarshal/unmarshal.go @@ -195,7 +195,7 @@ func (p *unmarshal) mapField(varName string, field *protogen.Field) { p.P(`}`) if p.unsafe { p.P(`if intStringLen`, varName, ` == 0 {`) - p.P(varName, ` = `, p.Ident("unsafe", `String`), `(nil, intStringLen`, varName, `)`) + p.P(varName, ` = ""`) p.P(`} else {`) p.P(varName, ` = `, p.Ident("unsafe", `String`), `(&dAtA[iNdEx], intStringLen`, varName, `)`) p.P(`}`) @@ -426,9 +426,7 @@ func (p *unmarshal) fieldItem(field *protogen.Field, fieldname string, message * if p.unsafe { str = "stringValue" p.P(`var stringValue string`) - p.P(`if intStringLen == 0 {`) - p.P(`stringValue = `, p.Ident("unsafe", `String`), `(nil, intStringLen)`) - p.P(`} else {`) + p.P(`if intStringLen > 0 {`) p.P(`stringValue = `, p.Ident("unsafe", `String`), `(&dAtA[iNdEx], intStringLen)`) p.P(`}`) } diff --git a/testproto/pool/pool_vtproto.pb.go b/testproto/pool/pool_vtproto.pb.go index bc5fe52..5f3a5c9 100644 --- a/testproto/pool/pool_vtproto.pb.go +++ b/testproto/pool/pool_vtproto.pb.go @@ -646,9 +646,7 @@ func (m *MemoryPoolExtension) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Foo1 = stringValue diff --git a/testproto/pool/pool_with_oneof_vtproto.pb.go b/testproto/pool/pool_with_oneof_vtproto.pb.go index 7c3b18b..1f95bdd 100644 --- a/testproto/pool/pool_with_oneof_vtproto.pb.go +++ b/testproto/pool/pool_with_oneof_vtproto.pb.go @@ -1798,9 +1798,7 @@ func (m *OneofTest_Test2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.B = append(m.B, stringValue) diff --git a/testproto/pool/pool_with_slice_reuse_vtproto.pb.go b/testproto/pool/pool_with_slice_reuse_vtproto.pb.go index 82f34ee..530cb2e 100644 --- a/testproto/pool/pool_with_slice_reuse_vtproto.pb.go +++ b/testproto/pool/pool_with_slice_reuse_vtproto.pb.go @@ -1386,9 +1386,7 @@ func (m *Test1) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Sl = append(m.Sl, stringValue) @@ -1686,9 +1684,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.C = append(m.C, stringValue) @@ -1760,9 +1756,7 @@ func (m *Slice2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.E = stringValue diff --git a/testproto/proto2/scalars_vtproto.pb.go b/testproto/proto2/scalars_vtproto.pb.go index 15e6804..6468538 100644 --- a/testproto/proto2/scalars_vtproto.pb.go +++ b/testproto/proto2/scalars_vtproto.pb.go @@ -10065,9 +10065,7 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -10105,9 +10103,7 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue @@ -10144,9 +10140,7 @@ func (m *StringMessage) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.RepeatedField = append(m.RepeatedField, stringValue) diff --git a/testproto/proto3opt/opt_vtproto.pb.go b/testproto/proto3opt/opt_vtproto.pb.go index 7445ceb..3df0d03 100644 --- a/testproto/proto3opt/opt_vtproto.pb.go +++ b/testproto/proto3opt/opt_vtproto.pb.go @@ -1109,9 +1109,7 @@ func (m *OptionalFieldInProto3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } s := stringValue diff --git a/testproto/unsafe/unsafe_vtproto.pb.go b/testproto/unsafe/unsafe_vtproto.pb.go index c6d12e0..d03d22e 100644 --- a/testproto/unsafe/unsafe_vtproto.pb.go +++ b/testproto/unsafe/unsafe_vtproto.pb.go @@ -2603,9 +2603,7 @@ func (m *UnsafeTest_Sub1) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.S = stringValue @@ -2723,9 +2721,7 @@ func (m *UnsafeTest_Sub2) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.S = append(m.S, stringValue) @@ -2892,7 +2888,7 @@ func (m *UnsafeTest_Sub3) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -3025,9 +3021,7 @@ func (m *UnsafeTest_Sub4) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Foo = &UnsafeTest_Sub4_S{S: stringValue} @@ -3195,7 +3189,7 @@ func (m *UnsafeTest_Sub5) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -3228,7 +3222,7 @@ func (m *UnsafeTest_Sub5) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapvalue == 0 { - mapvalue = unsafe.String(nil, intStringLenmapvalue) + mapvalue = "" } else { mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) } diff --git a/types/known/anypb/any_vtproto.pb.go b/types/known/anypb/any_vtproto.pb.go index 467bef1..c99b9e6 100644 --- a/types/known/anypb/any_vtproto.pb.go +++ b/types/known/anypb/any_vtproto.pb.go @@ -330,9 +330,7 @@ func (m *Any) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.TypeUrl = stringValue diff --git a/types/known/fieldmaskpb/field_mask_vtproto.pb.go b/types/known/fieldmaskpb/field_mask_vtproto.pb.go index e1c75ea..9f52025 100644 --- a/types/known/fieldmaskpb/field_mask_vtproto.pb.go +++ b/types/known/fieldmaskpb/field_mask_vtproto.pb.go @@ -286,9 +286,7 @@ func (m *FieldMask) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Paths = append(m.Paths, stringValue) diff --git a/types/known/structpb/struct_vtproto.pb.go b/types/known/structpb/struct_vtproto.pb.go index 1865d0d..835849e 100644 --- a/types/known/structpb/struct_vtproto.pb.go +++ b/types/known/structpb/struct_vtproto.pb.go @@ -1604,7 +1604,7 @@ func (m *Struct) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } if intStringLenmapkey == 0 { - mapkey = unsafe.String(nil, intStringLenmapkey) + mapkey = "" } else { mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } @@ -1769,9 +1769,7 @@ func (m *Value) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Kind = &structpb.Value_StringValue{StringValue: stringValue} diff --git a/types/known/wrapperspb/wrappers_vtproto.pb.go b/types/known/wrapperspb/wrappers_vtproto.pb.go index f4ad9e5..0dac9b2 100644 --- a/types/known/wrapperspb/wrappers_vtproto.pb.go +++ b/types/known/wrapperspb/wrappers_vtproto.pb.go @@ -2131,9 +2131,7 @@ func (m *StringValue) UnmarshalVTUnsafe(dAtA []byte) error { return io.ErrUnexpectedEOF } var stringValue string - if intStringLen == 0 { - stringValue = unsafe.String(nil, intStringLen) - } else { + if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } m.Value = stringValue