diff --git a/Makefile b/Makefile index b71fbc95..41c524d4 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 \ @@ -63,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 63afeeb4..5222f04e 100644 --- a/README.md +++ b/README.md @@ -108,16 +108,24 @@ 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. -## Well-known types + 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. -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. +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. -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`. +8. (Optional) Switch your RPC framework to use the optimized helpers (see following sections) + +## `vtprotobuf` package and well-known types + +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 diff --git a/cmd/protoc-gen-go-vtproto/main.go b/cmd/protoc-gen-go-vtproto/main.go index eec0fc68..90ca1243 100644 --- a/cmd/protoc-gen-go-vtproto/main.go +++ b/cmd/protoc-gen-go-vtproto/main.go @@ -27,8 +27,8 @@ func main() { f.Var(&cfg.Poolable, "pool", "use memory pooling for this object") f.Var(&cfg.PoolableExclude, "pool-exclude", "do not 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 '+')") + 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/conformance/internal/conformance/conformance.pb.go b/conformance/internal/conformance/conformance.pb.go index f8f463af..10a4962d 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/conformance_vtproto.pb.go b/conformance/internal/conformance/conformance_vtproto.pb.go index 837109ba..26232f3b 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,25 +2364,29 @@ 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 } - m.Failure = append(m.Failure, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Failure = append(m.Failure, stringValue) 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 +2409,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 +2437,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 +2450,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 +2469,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,16 +2483,20 @@ 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 } - m.Payload = &ConformanceRequest_JsonPayload{JsonPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Payload = &ConformanceRequest_JsonPayload{JsonPayload: stringValue} iNdEx = postIndex case 3: if wireType != 0 { @@ -2496,7 +2505,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 +2524,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,16 +2538,20 @@ 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 } - m.MessageType = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.MessageType = stringValue iNdEx = postIndex case 5: if wireType != 0 { @@ -2547,7 +2560,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 +2579,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 +2592,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 +2615,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,16 +2629,20 @@ 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 } - m.Payload = &ConformanceRequest_JspbPayload{JspbPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Payload = &ConformanceRequest_JspbPayload{JspbPayload: stringValue} iNdEx = postIndex case 8: if wireType != 2 { @@ -2634,7 +2651,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,16 +2665,20 @@ 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 } - m.Payload = &ConformanceRequest_TextPayload{TextPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Payload = &ConformanceRequest_TextPayload{TextPayload: stringValue} iNdEx = postIndex case 9: if wireType != 0 { @@ -2666,7 +2687,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 +2702,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 +2730,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 +2758,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,16 +2772,20 @@ 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 } - m.Result = &ConformanceResponse_ParseError{ParseError: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_ParseError{ParseError: stringValue} iNdEx = postIndex case 2: if wireType != 2 { @@ -2769,7 +2794,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,16 +2808,20 @@ 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 } - m.Result = &ConformanceResponse_RuntimeError{RuntimeError: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_RuntimeError{RuntimeError: stringValue} iNdEx = postIndex case 3: if wireType != 2 { @@ -2801,7 +2830,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 +2843,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 +2862,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,16 +2876,20 @@ 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 } - m.Result = &ConformanceResponse_JsonPayload{JsonPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_JsonPayload{JsonPayload: stringValue} iNdEx = postIndex case 5: if wireType != 2 { @@ -2865,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 @@ -2879,16 +2912,20 @@ 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 } - m.Result = &ConformanceResponse_Skipped{Skipped: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_Skipped{Skipped: stringValue} iNdEx = postIndex case 6: if wireType != 2 { @@ -2897,7 +2934,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,16 +2948,20 @@ 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 } - m.Result = &ConformanceResponse_SerializeError{SerializeError: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_SerializeError{SerializeError: stringValue} iNdEx = postIndex case 7: if wireType != 2 { @@ -2929,7 +2970,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,16 +2984,20 @@ 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 } - m.Result = &ConformanceResponse_JspbPayload{JspbPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_JspbPayload{JspbPayload: stringValue} iNdEx = postIndex case 8: if wireType != 2 { @@ -2961,7 +3006,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,25 +3020,29 @@ 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 } - m.Result = &ConformanceResponse_TextPayload{TextPayload: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Result = &ConformanceResponse_TextPayload{TextPayload: stringValue} 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 +3065,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 +3093,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 +3108,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.pb.go b/conformance/internal/conformance/test_messages_proto2.pb.go index 740affc9..8178fc3e 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_proto2_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto2_vtproto.pb.go index 0cd390da..afc122f9 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,26 +14981,30 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.Str = &s 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 +15027,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 +15055,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 +15070,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 +15098,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 +15126,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 +15146,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 +15166,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 +15186,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 +15206,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 +15227,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 +15317,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 +15338,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,16 +15352,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalString = &s iNdEx = postIndex case 15: @@ -15470,7 +15375,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 +15388,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 +15406,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 +15419,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 +15442,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 +15455,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 +15478,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 +15498,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 +15518,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,16 +15532,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalStringPiece = &s iNdEx = postIndex case 25: @@ -15646,7 +15555,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,16 +15569,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalCord = &s iNdEx = postIndex case 27: @@ -15679,7 +15592,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 +15605,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 +15626,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 +15643,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 +15656,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 +15680,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 +15702,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 +15719,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 +15732,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 +15756,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 +15778,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 +15795,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 +15808,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 +15832,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 +15854,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 +15871,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 +15884,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 +15908,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 +15930,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 +15948,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 +15961,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 +15985,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 +16008,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 +16026,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 +16039,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 +16063,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 +16094,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 +16107,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 +16146,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 +16159,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 +16198,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 +16211,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 +16250,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 +16263,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 +16303,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 +16316,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 +16357,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 +16370,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 +16402,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 +16419,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 +16432,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 +16450,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 +16474,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,16 +16488,20 @@ 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 } - m.RepeatedString = append(m.RepeatedString, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedString = append(m.RepeatedString, stringValue) iNdEx = postIndex case 45: if wireType != 2 { @@ -16593,7 +16510,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 +16523,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 +16541,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 +16554,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 +16575,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 +16588,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 +16607,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 +16624,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 +16637,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 +16654,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 +16676,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 +16693,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 +16706,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 +16723,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 +16747,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,16 +16761,20 @@ 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 } - m.RepeatedStringPiece = append(m.RepeatedStringPiece, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedStringPiece = append(m.RepeatedStringPiece, stringValue) iNdEx = postIndex case 55: if wireType != 2 { @@ -16862,7 +16783,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,16 +16797,20 @@ 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 } - m.RepeatedCord = append(m.RepeatedCord, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedCord = append(m.RepeatedCord, stringValue) iNdEx = postIndex case 56: if wireType != 2 { @@ -16894,7 +16819,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 +16832,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 +16851,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 +16867,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 +16882,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 +16896,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 +16918,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 +16931,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 +16950,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 +16966,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 +16981,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 +16995,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 +17017,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 +17030,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 +17049,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 +17065,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 +17080,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 +17094,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 +17116,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 +17129,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 +17148,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 +17164,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 +17179,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 +17193,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 +17215,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 +17228,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 +17247,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 +17264,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 +17282,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 +17298,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 +17320,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 +17333,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 +17352,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 +17369,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 +17387,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 +17403,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 +17425,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 +17438,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 +17457,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 +17484,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 +17506,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 +17519,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 +17538,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 +17565,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 +17587,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 +17600,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 +17619,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 +17646,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 +17668,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 +17681,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 +17700,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 +17727,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 +17749,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 +17762,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 +17781,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 +17797,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 +17819,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 +17841,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 +17854,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 +17873,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 +17889,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 +17911,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 +17933,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 +17946,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 +17965,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 +17982,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 +17999,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 +18014,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 +18036,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 +18049,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 +18068,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 +18085,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,22 +18099,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18203,25 +18132,29 @@ 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 } - mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + if intStringLenmapvalue == 0 { + mapvalue = "" + } else { + mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + } 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 +18171,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 +18184,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 +18203,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 +18220,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,22 +18234,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { 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 +18267,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 +18280,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 +18302,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 +18315,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 +18334,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 +18351,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,22 +18365,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18456,11 +18397,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 +18413,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 +18435,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 +18448,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 +18467,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 +18484,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,22 +18498,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18585,11 +18530,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 +18546,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 +18568,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 +18581,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 +18600,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 +18617,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,21 +18631,25 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } 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 +18663,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 +18685,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 +18698,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 +18717,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 +18734,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,21 +18748,25 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } 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 +18780,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 +18800,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 +18817,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 +18830,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 +18854,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 +18876,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 +18893,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 +18906,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 +18930,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 +18952,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 +18969,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 +18982,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 +19006,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 +19028,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 +19045,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 +19058,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 +19082,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 +19104,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 +19122,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 +19135,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 +19159,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 +19182,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 +19200,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 +19213,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 +19237,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 +19268,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 +19281,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 +19320,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 +19333,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 +19372,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 +19385,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 +19424,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 +19437,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 +19477,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 +19490,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 +19531,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 +19544,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 +19576,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 +19593,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 +19606,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 +19624,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 +19646,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 +19663,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 +19676,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 +19693,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 +19715,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 +19732,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 +19745,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 +19769,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 +19791,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 +19808,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 +19821,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 +19845,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 +19867,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 +19884,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 +19897,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 +19921,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 +19943,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 +19960,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 +19973,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 +19997,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 +20019,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 +20037,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 +20050,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 +20074,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 +20097,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 +20115,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 +20128,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 +20152,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 +20183,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 +20196,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 +20235,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 +20248,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 +20287,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 +20300,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 +20339,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 +20352,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 +20392,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 +20405,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 +20446,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 +20459,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 +20491,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 +20508,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 +20521,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 +20539,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 +20561,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 +20578,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 +20591,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 +20608,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 +20632,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 +20652,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 +20665,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 +20693,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,16 +20707,20 @@ 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 } - m.OneofField = &TestAllTypesProto2_OneofString{OneofString: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OneofField = &TestAllTypesProto2_OneofString{OneofString: stringValue} iNdEx = postIndex case 114: if wireType != 2 { @@ -20772,7 +20729,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 +20742,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 +20761,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 +20782,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 +20824,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 +20847,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 +20866,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 +20882,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 +20902,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 +20922,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 +20942,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 +20962,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 +20983,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 +21073,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 +21094,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,16 +21108,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.DefaultString = &s iNdEx = postIndex case 255: @@ -21170,7 +21131,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 +21144,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 +21162,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 +21182,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 +21202,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 +21222,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 +21242,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 +21262,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 +21282,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 +21302,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 +21322,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 +21342,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 +21362,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 +21382,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 +21402,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 +21422,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 +21442,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 +21462,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 +21482,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 +21502,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 +21517,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 +21553,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 +21581,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 +21596,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 +21624,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 +21652,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 +21667,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 +21695,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 +21723,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 +21743,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,16 +21757,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalString = &s iNdEx = postIndex case 1003: @@ -21815,7 +21780,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 +21793,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 +21819,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 +21838,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 +21854,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 +21873,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 +21890,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 +21903,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 +21927,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 +21946,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 +21974,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 +21997,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 +22025,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 +22048,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 +22076,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 +22104,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,26 +22118,30 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.Data = &s 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.pb.go b/conformance/internal/conformance/test_messages_proto3.pb.go index 3aa0cf3f..198a99a2 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/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go index 112590cc..7de867ea 100644 --- a/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go +++ b/conformance/internal/conformance/test_messages_proto3_vtproto.pb.go @@ -7,9 +7,11 @@ 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" + 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 +91,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 +574,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 +598,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 +612,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 +1776,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 +1868,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 +1885,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 +1902,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 } } @@ -2280,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 } @@ -2332,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-- @@ -2459,24 +2415,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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x14 i-- @@ -2485,24 +2429,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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2511,24 +2443,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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2542,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-- @@ -2556,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-- @@ -2570,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-- @@ -2584,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-- @@ -2592,31 +2512,19 @@ 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-- 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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2628,31 +2536,19 @@ 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-- 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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -2664,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-- @@ -2676,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-- @@ -2688,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-- @@ -2701,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-- @@ -2715,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-- @@ -2729,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-- @@ -2743,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-- @@ -2757,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-- @@ -2771,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-- @@ -2785,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-- @@ -2799,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-- @@ -2813,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-- @@ -2826,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-- @@ -2838,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-- @@ -2850,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-- @@ -2862,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-- @@ -2874,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-- @@ -2886,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-- @@ -2898,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-- @@ -2910,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-- @@ -2922,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-- @@ -2930,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-- @@ -3016,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-- @@ -3026,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-- @@ -3035,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-- @@ -3044,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-- @@ -3053,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-- @@ -3062,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-- @@ -3072,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 @@ -3086,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-- @@ -3101,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-- @@ -3113,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-- @@ -3125,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-- @@ -3136,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-- @@ -3147,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-- @@ -3158,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-- @@ -3169,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-- @@ -3178,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 @@ -3192,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-- @@ -3201,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 @@ -3215,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-- @@ -3224,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 @@ -3237,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-- @@ -3246,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 @@ -3259,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-- @@ -3268,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 @@ -3282,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-- @@ -3291,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 @@ -3305,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-- @@ -3315,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-- @@ -3334,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-- @@ -3358,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-- @@ -3382,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-- @@ -3403,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-- @@ -3424,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-- @@ -3459,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-- @@ -3474,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-- @@ -3492,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-- @@ -3514,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-- @@ -3533,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-- @@ -3552,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-- @@ -3571,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-- @@ -3582,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-- @@ -3599,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-- @@ -3616,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-- @@ -3633,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-- @@ -3650,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-- @@ -3667,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-- @@ -3684,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-- @@ -3695,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-- @@ -3705,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 @@ -3719,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-- @@ -3728,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 @@ -3742,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-- @@ -3755,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-- @@ -3769,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-- @@ -3780,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-- @@ -3791,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-- @@ -3807,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-- @@ -3819,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-- @@ -3831,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-- @@ -3842,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-- @@ -3853,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-- @@ -3864,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-- @@ -3875,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-- @@ -3884,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 @@ -3898,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-- @@ -3907,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 @@ -3921,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-- @@ -3930,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 @@ -3943,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-- @@ -3952,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 @@ -3965,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-- @@ -3974,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 @@ -3988,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-- @@ -3997,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 @@ -4011,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-- @@ -4023,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-- @@ -4032,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-- @@ -4041,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-- @@ -4074,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-- @@ -4086,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-- @@ -4095,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 } @@ -4153,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 } @@ -4192,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-- @@ -4212,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-- @@ -4229,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-- @@ -4245,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-- @@ -4278,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-- @@ -4322,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-- @@ -4336,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-- @@ -4374,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 } @@ -4483,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 } @@ -4526,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-- @@ -4653,24 +4549,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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x14 i-- @@ -4679,24 +4563,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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4705,24 +4577,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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4736,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-- @@ -4750,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-- @@ -4764,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-- @@ -4778,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-- @@ -4786,31 +4646,19 @@ 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-- 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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4822,31 +4670,19 @@ 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-- 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 = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x13 i-- @@ -4858,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-- @@ -4870,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-- @@ -4882,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-- @@ -4895,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-- @@ -4909,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-- @@ -4923,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-- @@ -4937,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-- @@ -4951,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-- @@ -4965,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-- @@ -4979,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-- @@ -4993,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-- @@ -5007,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-- @@ -5020,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-- @@ -5032,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-- @@ -5044,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-- @@ -5056,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-- @@ -5068,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-- @@ -5080,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-- @@ -5092,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-- @@ -5104,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-- @@ -5116,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-- @@ -5194,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-- @@ -5280,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-- @@ -5290,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-- @@ -5299,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-- @@ -5308,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-- @@ -5317,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-- @@ -5326,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-- @@ -5336,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 @@ -5350,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-- @@ -5365,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-- @@ -5377,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-- @@ -5389,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-- @@ -5400,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-- @@ -5411,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-- @@ -5422,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-- @@ -5433,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-- @@ -5442,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 @@ -5456,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-- @@ -5465,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 @@ -5479,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-- @@ -5488,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 @@ -5501,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-- @@ -5510,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 @@ -5523,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-- @@ -5532,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 @@ -5546,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-- @@ -5555,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 @@ -5569,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-- @@ -5579,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-- @@ -5598,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-- @@ -5622,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-- @@ -5646,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-- @@ -5667,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-- @@ -5688,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-- @@ -5723,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-- @@ -5738,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-- @@ -5756,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-- @@ -5778,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-- @@ -5797,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-- @@ -5816,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-- @@ -5835,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-- @@ -5846,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-- @@ -5863,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-- @@ -5880,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-- @@ -5897,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-- @@ -5914,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-- @@ -5931,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-- @@ -5948,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-- @@ -5959,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-- @@ -5969,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 @@ -5983,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-- @@ -5992,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 @@ -6006,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-- @@ -6019,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-- @@ -6033,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-- @@ -6044,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-- @@ -6055,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-- @@ -6071,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-- @@ -6083,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-- @@ -6095,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-- @@ -6106,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-- @@ -6117,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-- @@ -6128,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-- @@ -6139,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-- @@ -6148,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 @@ -6162,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-- @@ -6171,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 @@ -6185,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-- @@ -6194,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 @@ -6207,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-- @@ -6216,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 @@ -6229,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-- @@ -6238,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 @@ -6252,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-- @@ -6261,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 @@ -6275,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-- @@ -6287,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-- @@ -6296,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-- @@ -6305,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-- @@ -6338,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-- @@ -6350,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-- @@ -6359,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 } @@ -6417,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 } @@ -6456,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-- @@ -6476,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-- @@ -6493,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-- @@ -6509,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-- @@ -6542,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-- @@ -6586,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-- @@ -6600,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-- @@ -6638,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 } @@ -6718,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 @@ -6735,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 @@ -6775,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 { @@ -6976,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 { @@ -6984,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 { @@ -6992,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 { @@ -7000,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 { @@ -7024,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 { @@ -7052,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 { @@ -7065,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 { @@ -7209,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 { @@ -7217,246 +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 { - if size, ok := interface{}(m.OptionalStruct).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.OptionalStruct) - } - n += 2 + l + sov(uint64(l)) + l = (*structpb1.Struct)(m.OptionalStruct).SizeVT() + 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 { - if size, ok := interface{}(m.OptionalValue).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.OptionalValue) - } - n += 2 + l + sov(uint64(l)) + l = (*structpb1.Value)(m.OptionalValue).SizeVT() + 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 { - if size, ok := interface{}(e).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(e) - } - n += 2 + l + sov(uint64(l)) + l = (*structpb1.Value)(e).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(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) - } - n += 2 + l + sov(uint64(l)) + l = (*structpb1.ListValue)(e).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(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) - } - n += 2 + l + sov(uint64(l)) + l = (*structpb1.Struct)(e).SizeVT() + 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 @@ -7468,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) { @@ -7479,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 } @@ -7490,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) { @@ -7500,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) { @@ -7518,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) { @@ -7545,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) { @@ -7554,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) { @@ -7564,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 @@ -7598,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 @@ -7626,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 @@ -7645,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 @@ -7658,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 @@ -7676,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 @@ -7704,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 @@ -7732,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 @@ -7751,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 @@ -7770,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 @@ -7789,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 @@ -7808,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 @@ -7829,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 @@ -7912,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 @@ -7932,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 @@ -7946,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 @@ -7964,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 @@ -7977,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 @@ -7998,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 @@ -8011,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 @@ -8034,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 @@ -8047,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 @@ -8070,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 @@ -8089,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 @@ -8108,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 @@ -8127,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 @@ -8141,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 @@ -8159,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 @@ -8173,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 @@ -8191,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 @@ -8204,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 @@ -8225,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 @@ -8242,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 @@ -8255,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 @@ -8279,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 @@ -8301,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 @@ -8318,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 @@ -8331,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 @@ -8355,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 @@ -8377,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 @@ -8394,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 @@ -8407,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 @@ -8431,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 @@ -8453,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 @@ -8470,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 @@ -8483,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 @@ -8507,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 @@ -8529,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 @@ -8547,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 @@ -8560,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 @@ -8584,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 @@ -8607,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 @@ -8625,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 @@ -8638,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 @@ -8662,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 @@ -8693,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 @@ -8706,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 @@ -8745,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 @@ -8758,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 @@ -8797,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 @@ -8810,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 @@ -8849,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 @@ -8862,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 @@ -8902,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 @@ -8915,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 @@ -8956,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 @@ -8969,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 @@ -9001,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 @@ -9018,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 @@ -9031,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 @@ -9049,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 @@ -9073,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 @@ -9087,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 @@ -9105,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 @@ -9118,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 @@ -9137,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 @@ -9150,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 @@ -9171,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 @@ -9184,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 @@ -9203,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 @@ -9220,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 @@ -9233,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 @@ -9250,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 @@ -9272,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 @@ -9289,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 @@ -9302,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 @@ -9319,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 @@ -9343,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 @@ -9357,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 @@ -9375,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 @@ -9389,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 @@ -9407,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 @@ -9420,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 @@ -9439,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 @@ -9455,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 @@ -9470,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 @@ -9484,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 @@ -9506,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 @@ -9519,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 @@ -9538,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 @@ -9554,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 @@ -9569,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 @@ -9583,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 @@ -9605,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 @@ -9618,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 @@ -9637,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 @@ -9653,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 @@ -9668,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 @@ -9682,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 @@ -9704,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 @@ -9717,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 @@ -9736,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 @@ -9752,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 @@ -9767,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 @@ -9781,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 @@ -9803,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 @@ -9816,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 @@ -9835,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 @@ -9852,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 @@ -9870,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 @@ -9886,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 @@ -9908,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 @@ -9921,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 @@ -9940,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 @@ -9957,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 @@ -9975,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 @@ -9991,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 @@ -10013,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 @@ -10026,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 @@ -10045,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 @@ -10072,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 @@ -10094,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 @@ -10107,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 @@ -10126,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 @@ -10153,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 @@ -10175,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 @@ -10188,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 @@ -10207,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 @@ -10234,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 @@ -10256,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 @@ -10269,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 @@ -10288,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 @@ -10315,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 @@ -10337,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 @@ -10350,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 @@ -10369,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 @@ -10385,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 @@ -10407,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 @@ -10429,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 @@ -10442,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 @@ -10461,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 @@ -10477,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 @@ -10499,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 @@ -10521,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 @@ -10534,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 @@ -10553,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 @@ -10570,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 @@ -10587,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 @@ -10602,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 @@ -10624,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 @@ -10637,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 @@ -10656,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 @@ -10673,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 @@ -10687,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 @@ -10702,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 @@ -10716,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 @@ -10729,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 @@ -10751,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 @@ -10764,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 @@ -10783,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 @@ -10800,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 @@ -10814,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 @@ -10829,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 @@ -10843,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 @@ -10857,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 @@ -10879,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 @@ -10892,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 @@ -10911,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 @@ -10928,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 @@ -10942,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 @@ -10957,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 @@ -10970,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 @@ -10986,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 @@ -11008,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 @@ -11021,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 @@ -11040,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 @@ -11057,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 @@ -11071,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 @@ -11086,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 @@ -11099,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 @@ -11115,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 @@ -11137,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 @@ -11150,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 @@ -11169,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 @@ -11186,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 @@ -11200,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 @@ -11214,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 @@ -11228,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 @@ -11250,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 @@ -11263,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 @@ -11282,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 @@ -11299,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 @@ -11313,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 @@ -11327,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 @@ -11341,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 @@ -11361,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 @@ -11378,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 @@ -11391,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 @@ -11415,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 @@ -11437,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 @@ -11454,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 @@ -11467,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 @@ -11491,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 @@ -11513,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 @@ -11530,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 @@ -11543,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 @@ -11567,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 @@ -11589,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 @@ -11606,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 @@ -11619,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 @@ -11643,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 @@ -11665,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 @@ -11683,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 @@ -11696,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 @@ -11720,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 @@ -11743,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 @@ -11761,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 @@ -11774,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 @@ -11798,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 @@ -11829,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 @@ -11842,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 @@ -11881,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 @@ -11894,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 @@ -11933,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 @@ -11946,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 @@ -11985,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 @@ -11998,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 @@ -12038,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 @@ -12051,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 @@ -12092,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 @@ -12105,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 @@ -12137,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 @@ -12154,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 @@ -12167,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 @@ -12185,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 @@ -12207,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 @@ -12224,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 @@ -12237,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 @@ -12254,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 @@ -12276,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 @@ -12293,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 @@ -12306,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 @@ -12330,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 @@ -12352,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 @@ -12369,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 @@ -12382,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 @@ -12406,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 @@ -12428,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 @@ -12445,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 @@ -12458,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 @@ -12482,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 @@ -12504,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 @@ -12521,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 @@ -12534,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 @@ -12558,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 @@ -12580,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 @@ -12598,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 @@ -12611,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 @@ -12635,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 @@ -12658,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 @@ -12676,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 @@ -12689,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 @@ -12713,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 @@ -12744,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 @@ -12757,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 @@ -12796,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 @@ -12809,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 @@ -12848,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 @@ -12861,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 @@ -12900,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 @@ -12913,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 @@ -12953,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 @@ -12966,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 @@ -13007,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 @@ -13020,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 @@ -13052,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 @@ -13069,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 @@ -13082,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 @@ -13100,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 @@ -13122,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 @@ -13139,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 @@ -13152,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 @@ -13169,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 @@ -13193,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 @@ -13213,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 @@ -13226,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 @@ -13254,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 @@ -13268,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 @@ -13286,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 @@ -13299,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 @@ -13319,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 @@ -13340,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 @@ -13382,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 @@ -13402,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 @@ -13422,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 @@ -13435,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 @@ -13458,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 @@ -13471,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 @@ -13494,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 @@ -13507,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 @@ -13530,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 @@ -13543,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 @@ -13566,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 @@ -13579,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 @@ -13602,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 @@ -13615,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 @@ -13638,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 @@ -13651,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 @@ -13674,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 @@ -13687,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 @@ -13710,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 @@ -13723,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 @@ -13746,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 @@ -13759,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 @@ -13780,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 @@ -13793,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 @@ -13814,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 @@ -13827,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 @@ -13848,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 @@ -13861,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 @@ -13882,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 @@ -13895,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 @@ -13916,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 @@ -13929,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 @@ -13950,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 @@ -13963,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 @@ -13984,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 @@ -13997,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 @@ -14018,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 @@ -14031,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 @@ -14052,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 @@ -14065,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 @@ -14088,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 @@ -14101,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 @@ -14124,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 @@ -14137,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 @@ -14160,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 @@ -14173,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 @@ -14185,16 +13991,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: @@ -14204,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 @@ -14217,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 @@ -14240,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 @@ -14253,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 @@ -14265,16 +14063,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: @@ -14284,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 @@ -14303,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 @@ -14316,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 @@ -14337,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 @@ -14350,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 @@ -14371,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 @@ -14384,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 @@ -14405,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 @@ -14418,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 @@ -14439,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 @@ -14452,26 +14242,18 @@ 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 } 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: @@ -14481,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 @@ -14494,26 +14276,18 @@ 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 } 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: @@ -14523,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 @@ -14536,26 +14310,18 @@ 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 } 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: @@ -14565,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 @@ -14584,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 @@ -14603,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 @@ -14622,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 @@ -14641,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 @@ -14660,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 @@ -14679,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 @@ -14698,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 @@ -14717,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 @@ -14736,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 @@ -14755,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 @@ -14774,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 @@ -14793,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 @@ -14812,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 @@ -14831,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 @@ -14850,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 @@ -14869,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 @@ -14888,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 @@ -14902,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 @@ -14930,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 @@ -14958,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 @@ -14972,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 @@ -15000,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 @@ -15023,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 @@ -15051,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 @@ -15074,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 @@ -15102,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 @@ -15130,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 @@ -15149,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 @@ -15162,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 @@ -15180,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 @@ -15208,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 @@ -15236,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 @@ -15255,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 @@ -15274,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 @@ -15293,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 @@ -15312,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 @@ -15333,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 @@ -15416,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 @@ -15436,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 @@ -15450,16 +15216,20 @@ 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 } - m.OptionalString = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OptionalString = stringValue iNdEx = postIndex case 15: if wireType != 2 { @@ -15468,7 +15238,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 @@ -15481,11 +15251,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 @@ -15499,7 +15269,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 @@ -15512,11 +15282,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 @@ -15535,7 +15305,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 @@ -15548,11 +15318,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 @@ -15571,7 +15341,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 @@ -15590,7 +15360,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 @@ -15609,7 +15379,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 @@ -15628,7 +15398,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 @@ -15642,16 +15412,20 @@ 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 } - m.OptionalStringPiece = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OptionalStringPiece = stringValue iNdEx = postIndex case 25: if wireType != 2 { @@ -15660,7 +15434,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 @@ -15674,16 +15448,20 @@ 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 } - m.OptionalCord = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OptionalCord = stringValue iNdEx = postIndex case 27: if wireType != 2 { @@ -15692,7 +15470,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 @@ -15705,11 +15483,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 @@ -15726,7 +15504,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 @@ -15743,7 +15521,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 @@ -15756,11 +15534,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 @@ -15780,7 +15558,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 @@ -15802,7 +15580,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 @@ -15819,7 +15597,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 @@ -15832,11 +15610,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 @@ -15856,7 +15634,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 @@ -15878,7 +15656,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 @@ -15895,7 +15673,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 @@ -15908,11 +15686,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 @@ -15932,7 +15710,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 @@ -15954,7 +15732,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 @@ -15971,7 +15749,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 @@ -15984,11 +15762,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 @@ -16008,7 +15786,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 @@ -16030,7 +15808,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 @@ -16048,7 +15826,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 @@ -16061,11 +15839,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 @@ -16085,7 +15863,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 @@ -16108,7 +15886,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 @@ -16126,7 +15904,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 @@ -16139,11 +15917,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 @@ -16163,7 +15941,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 @@ -16194,7 +15972,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 @@ -16207,11 +15985,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 @@ -16246,7 +16024,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 @@ -16259,11 +16037,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 @@ -16298,7 +16076,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 @@ -16311,11 +16089,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 @@ -16350,7 +16128,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 @@ -16363,11 +16141,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 @@ -16403,7 +16181,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 @@ -16416,11 +16194,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 @@ -16457,7 +16235,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 @@ -16470,11 +16248,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 @@ -16502,7 +16280,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 @@ -16519,7 +16297,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 @@ -16532,11 +16310,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 @@ -16550,7 +16328,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 @@ -16574,7 +16352,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 @@ -16588,16 +16366,20 @@ 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 } - m.RepeatedString = append(m.RepeatedString, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedString = append(m.RepeatedString, stringValue) iNdEx = postIndex case 45: if wireType != 2 { @@ -16606,7 +16388,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 @@ -16619,11 +16401,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 @@ -16637,7 +16419,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 @@ -16650,11 +16432,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 @@ -16671,7 +16453,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 @@ -16684,11 +16466,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 @@ -16703,7 +16485,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 @@ -16720,7 +16502,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 @@ -16733,11 +16515,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 @@ -16750,7 +16532,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 @@ -16772,7 +16554,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 @@ -16789,7 +16571,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 @@ -16802,11 +16584,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 @@ -16819,7 +16601,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 @@ -16843,7 +16625,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 @@ -16857,16 +16639,20 @@ 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 } - m.RepeatedStringPiece = append(m.RepeatedStringPiece, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedStringPiece = append(m.RepeatedStringPiece, stringValue) iNdEx = postIndex case 55: if wireType != 2 { @@ -16875,7 +16661,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 @@ -16889,16 +16675,20 @@ 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 } - m.RepeatedCord = append(m.RepeatedCord, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedCord = append(m.RepeatedCord, stringValue) iNdEx = postIndex case 56: if wireType != 2 { @@ -16907,7 +16697,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 @@ -16920,11 +16710,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 @@ -16939,7 +16729,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 @@ -16955,7 +16745,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 @@ -16970,7 +16760,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 @@ -16984,12 +16774,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 @@ -17006,7 +16796,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 @@ -17019,11 +16809,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 @@ -17038,7 +16828,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 @@ -17054,7 +16844,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 @@ -17069,7 +16859,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 @@ -17083,12 +16873,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 @@ -17105,7 +16895,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 @@ -17118,11 +16908,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 @@ -17137,7 +16927,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 @@ -17153,7 +16943,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 @@ -17168,7 +16958,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 @@ -17182,12 +16972,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 @@ -17204,7 +16994,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 @@ -17217,11 +17007,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 @@ -17236,7 +17026,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 @@ -17252,7 +17042,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 @@ -17267,7 +17057,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 @@ -17281,12 +17071,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 @@ -17303,7 +17093,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 @@ -17316,11 +17106,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 @@ -17335,7 +17125,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 @@ -17352,7 +17142,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 @@ -17370,7 +17160,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 @@ -17386,12 +17176,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 @@ -17408,7 +17198,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 @@ -17421,11 +17211,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 @@ -17440,7 +17230,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 @@ -17457,7 +17247,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 @@ -17475,7 +17265,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 @@ -17491,12 +17281,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 @@ -17513,7 +17303,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 @@ -17526,11 +17316,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 @@ -17545,7 +17335,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 @@ -17572,12 +17362,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 @@ -17594,7 +17384,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 @@ -17607,11 +17397,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 @@ -17626,7 +17416,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 @@ -17653,12 +17443,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 @@ -17675,7 +17465,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 @@ -17688,11 +17478,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 @@ -17707,7 +17497,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 @@ -17734,12 +17524,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 @@ -17756,7 +17546,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 @@ -17769,11 +17559,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 @@ -17788,7 +17578,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 @@ -17815,12 +17605,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 @@ -17837,7 +17627,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 @@ -17850,11 +17640,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 @@ -17869,7 +17659,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 @@ -17885,7 +17675,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 @@ -17907,12 +17697,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 @@ -17929,7 +17719,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 @@ -17942,11 +17732,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 @@ -17961,7 +17751,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 @@ -17977,7 +17767,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 @@ -17999,12 +17789,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 @@ -18021,7 +17811,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 @@ -18034,11 +17824,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 @@ -18053,7 +17843,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 @@ -18070,7 +17860,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 @@ -18087,7 +17877,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 @@ -18102,12 +17892,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 @@ -18124,7 +17914,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 @@ -18137,11 +17927,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 @@ -18156,7 +17946,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 @@ -18173,7 +17963,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 @@ -18187,22 +17977,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18216,25 +18010,29 @@ 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 } - mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + if intStringLenmapvalue == 0 { + mapvalue = "" + } else { + mapvalue = unsafe.String(&dAtA[iNdEx], intStringLenmapvalue) + } 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 @@ -18251,7 +18049,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 @@ -18264,11 +18062,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 @@ -18283,7 +18081,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 @@ -18300,7 +18098,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 @@ -18314,22 +18112,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18343,11 +18145,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 @@ -18356,12 +18158,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 @@ -18378,7 +18180,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 @@ -18391,11 +18193,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 @@ -18410,7 +18212,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 @@ -18427,7 +18229,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 @@ -18441,22 +18243,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18469,11 +18275,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 @@ -18485,12 +18291,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 @@ -18507,7 +18313,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 @@ -18520,11 +18326,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 @@ -18539,7 +18345,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 @@ -18556,7 +18362,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 @@ -18570,22 +18376,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18598,11 +18408,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 @@ -18614,12 +18424,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 @@ -18636,7 +18446,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 @@ -18649,11 +18459,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 @@ -18668,7 +18478,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 @@ -18685,7 +18495,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 @@ -18699,21 +18509,25 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18727,12 +18541,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 @@ -18749,7 +18563,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 @@ -18762,11 +18576,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 @@ -18781,7 +18595,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 @@ -18798,7 +18612,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 @@ -18812,21 +18626,25 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -18840,12 +18658,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 @@ -18860,7 +18678,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 @@ -18877,7 +18695,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 @@ -18890,11 +18708,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 @@ -18914,7 +18732,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 @@ -18936,7 +18754,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 @@ -18953,7 +18771,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 @@ -18966,11 +18784,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 @@ -18990,7 +18808,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 @@ -19012,7 +18830,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 @@ -19029,7 +18847,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 @@ -19042,11 +18860,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 @@ -19066,7 +18884,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 @@ -19088,7 +18906,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 @@ -19105,7 +18923,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 @@ -19118,11 +18936,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 @@ -19142,7 +18960,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 @@ -19164,7 +18982,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 @@ -19182,7 +19000,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 @@ -19195,11 +19013,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 @@ -19219,7 +19037,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 @@ -19242,7 +19060,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 @@ -19260,7 +19078,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 @@ -19273,11 +19091,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 @@ -19297,7 +19115,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 @@ -19328,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 @@ -19341,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 @@ -19380,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 @@ -19393,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 @@ -19432,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 @@ -19445,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 @@ -19484,7 +19302,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 @@ -19497,11 +19315,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 @@ -19537,7 +19355,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 @@ -19550,11 +19368,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 @@ -19591,7 +19409,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 @@ -19604,11 +19422,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 @@ -19636,7 +19454,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 @@ -19653,7 +19471,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 @@ -19666,11 +19484,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 @@ -19684,7 +19502,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 @@ -19706,7 +19524,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 @@ -19723,7 +19541,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 @@ -19736,11 +19554,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 @@ -19753,7 +19571,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 @@ -19775,7 +19593,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 @@ -19792,7 +19610,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 @@ -19805,11 +19623,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 @@ -19829,7 +19647,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 @@ -19851,7 +19669,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 @@ -19868,7 +19686,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 @@ -19881,11 +19699,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 @@ -19905,7 +19723,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 @@ -19927,7 +19745,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 @@ -19944,7 +19762,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 @@ -19957,11 +19775,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 @@ -19981,7 +19799,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 @@ -20003,7 +19821,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 @@ -20020,7 +19838,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 @@ -20033,11 +19851,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 @@ -20057,7 +19875,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 @@ -20079,7 +19897,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 @@ -20097,7 +19915,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 @@ -20110,11 +19928,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 @@ -20134,7 +19952,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 @@ -20157,7 +19975,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 @@ -20175,7 +19993,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 @@ -20188,11 +20006,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 @@ -20212,7 +20030,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 @@ -20243,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 @@ -20256,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 @@ -20295,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 @@ -20308,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 @@ -20347,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 @@ -20360,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 @@ -20399,7 +20217,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 @@ -20412,11 +20230,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 @@ -20452,7 +20270,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 @@ -20465,11 +20283,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 @@ -20506,7 +20324,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 @@ -20519,11 +20337,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 @@ -20551,7 +20369,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 @@ -20568,7 +20386,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 @@ -20581,11 +20399,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 @@ -20599,7 +20417,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 @@ -20621,7 +20439,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 @@ -20638,7 +20456,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 @@ -20651,11 +20469,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 @@ -20668,7 +20486,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 @@ -20692,7 +20510,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 @@ -20712,7 +20530,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 @@ -20725,11 +20543,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 @@ -20753,7 +20571,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 @@ -20767,16 +20585,20 @@ 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 } - m.OneofField = &TestAllTypesProto3_OneofString{OneofString: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OneofField = &TestAllTypesProto3_OneofString{OneofString: stringValue} iNdEx = postIndex case 114: if wireType != 2 { @@ -20785,7 +20607,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 @@ -20798,11 +20620,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 @@ -20817,7 +20639,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 @@ -20838,7 +20660,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 @@ -20880,7 +20702,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 @@ -20900,7 +20722,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 @@ -20920,7 +20742,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 @@ -20933,11 +20755,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 @@ -20956,7 +20778,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 @@ -20969,11 +20791,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 @@ -20992,7 +20814,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 @@ -21005,11 +20827,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 @@ -21028,7 +20850,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 @@ -21041,11 +20863,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 @@ -21064,7 +20886,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 @@ -21077,11 +20899,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 @@ -21100,7 +20922,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 @@ -21113,11 +20935,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 @@ -21136,7 +20958,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 @@ -21149,11 +20971,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 @@ -21172,7 +20994,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 @@ -21185,11 +21007,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 @@ -21208,7 +21030,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 @@ -21221,11 +21043,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 @@ -21244,7 +21066,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 @@ -21257,11 +21079,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 @@ -21278,7 +21100,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 @@ -21291,11 +21113,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 @@ -21312,7 +21134,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 @@ -21325,11 +21147,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 @@ -21346,7 +21168,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 @@ -21359,11 +21181,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 @@ -21380,7 +21202,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 @@ -21393,11 +21215,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 @@ -21414,7 +21236,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 @@ -21427,11 +21249,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 @@ -21448,7 +21270,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 @@ -21461,11 +21283,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 @@ -21482,7 +21304,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 @@ -21495,11 +21317,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 @@ -21516,7 +21338,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 @@ -21529,11 +21351,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 @@ -21550,7 +21372,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 +21385,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 @@ -21586,7 +21408,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 @@ -21599,11 +21421,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 @@ -21622,7 +21444,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 @@ -21635,11 +21457,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 @@ -21658,7 +21480,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 @@ -21671,11 +21493,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 @@ -21683,16 +21505,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: @@ -21702,7 +21516,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 @@ -21715,11 +21529,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 @@ -21738,7 +21552,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 @@ -21751,11 +21565,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 @@ -21763,16 +21577,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: @@ -21782,7 +21588,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 @@ -21801,7 +21607,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 @@ -21814,11 +21620,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 @@ -21835,7 +21641,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 @@ -21848,11 +21654,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 @@ -21869,7 +21675,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 @@ -21882,11 +21688,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 @@ -21903,7 +21709,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 @@ -21916,11 +21722,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 @@ -21937,7 +21743,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 @@ -21950,26 +21756,18 @@ 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 } 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: @@ -21979,7 +21777,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 @@ -21992,26 +21790,18 @@ 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 } 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: @@ -22021,7 +21811,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 @@ -22034,26 +21824,18 @@ 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 } 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: @@ -22063,7 +21845,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 @@ -22082,7 +21864,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 @@ -22101,7 +21883,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 @@ -22120,7 +21902,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 @@ -22139,7 +21921,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 @@ -22158,7 +21940,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 @@ -22177,7 +21959,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 @@ -22196,7 +21978,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 @@ -22215,7 +21997,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 @@ -22234,7 +22016,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 @@ -22253,7 +22035,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 @@ -22272,7 +22054,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 @@ -22291,7 +22073,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 @@ -22310,7 +22092,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 @@ -22329,7 +22111,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 @@ -22348,7 +22130,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 @@ -22367,7 +22149,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 @@ -22386,7 +22168,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 @@ -22400,12 +22182,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 @@ -22428,7 +22210,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 @@ -22456,7 +22238,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 @@ -22470,12 +22252,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 @@ -22498,7 +22280,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 @@ -22521,12 +22303,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 @@ -22549,7 +22331,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 @@ -22572,12 +22354,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 3683c355..187a5a81 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 @@ -58,7 +55,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 +73,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 +204,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 +248,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 +269,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 +292,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/features/equal/equal.go b/features/equal/equal.go index 03cbe028..3b51584c 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 { @@ -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`) @@ -249,15 +272,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/grpc/grpc_plugin.go b/features/grpc/grpc_plugin.go index 5212b9e0..76768728 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 c24e9276..9f323ced 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`) @@ -620,8 +604,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(`}`) @@ -635,7 +622,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(`}`) } @@ -650,8 +642,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/pool/pool.go b/features/pool/pool.go index efb0f41c..004386b0 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) @@ -77,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: diff --git a/features/size/size.go b/features/size/size.go index 2fda5d5d..61bf3da1 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,28 +40,14 @@ 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.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`) @@ -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") @@ -305,8 +298,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(`}`) @@ -325,6 +330,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/features/unmarshal/unmarshal.go b/features/unmarshal/unmarshal.go index 77d65dc1..79e929b0 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" @@ -146,13 +53,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(`}`) @@ -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,17 +184,21 @@ 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`)) p.P(`}`) if p.unsafe { + p.P(`if intStringLen`, varName, ` == 0 {`) + p.P(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, `])`) } @@ -296,11 +207,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 +225,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,18 +413,22 @@ 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`)) 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`), `(&dAtA[iNdEx], intStringLen)`) + p.P(`}`) } if oneof { p.P(`m.`, fieldname, ` = &`, field.GoIdent, `{`, field.GoName, ": ", str, `}`) @@ -537,12 +452,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 +465,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 +512,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 +558,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 +709,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 +811,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 34c6b258..c34e4e76 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 bfd55dbc..1d8b7410 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 { @@ -115,6 +105,30 @@ 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 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{ @@ -132,21 +146,51 @@ 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"}, +} + +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 { - if message == nil || !p.Config.WellKnownTypes { + if message == nil { return false } _, ok := wellKnownTypes[message.Desc.FullName()] return ok } +func (p *GeneratedFile) WellKnownFieldMap(field *protogen.Field) protogen.GoIdent { + if field == nil { + 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 { + if message == nil { 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 d6962248..cbd1600d 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -6,19 +6,15 @@ package generator import ( "fmt" - "path" "runtime/debug" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoimpl" "google.golang.org/protobuf/types/pluginpb" -) -type featureHelpers struct { - path protogen.GoImportPath - feature int -} + "github.com/planetscale/vtprotobuf/generator/pattern" +) type ObjectSet struct { mp map[string]bool @@ -39,7 +35,7 @@ func (o ObjectSet) Contains(g protogen.GoIdent) bool { for wildcard := range o.mp { // Ignore malformed pattern error because pattern already checked in Set - if ok, _ := path.Match(wildcard, objectPath); ok { + if ok, _ := pattern.Match(wildcard, objectPath); ok { return true } } @@ -48,11 +44,9 @@ func (o ObjectSet) Contains(g protogen.GoIdent) bool { } func (o ObjectSet) Set(s string) error { - // Checks if pattern not malformed - if _, err := path.Match(s, ""); err != nil { - return err + if !pattern.ValidatePattern(s) { + return pattern.ErrBadPattern } - o.mp[s] = true return nil } @@ -65,13 +59,13 @@ type Config struct { Wrap bool WellKnownTypes bool AllowEmpty bool + BuildTag string } type Generator struct { plugin *protogen.Plugin cfg *Config features []Feature - seen map[featureHelpers]bool local map[protoreflect.FullName]bool } @@ -96,7 +90,6 @@ func NewGenerator(plugin *protogen.Plugin, featureNames []string, cfg *Config) ( plugin: plugin, cfg: cfg, features: features, - seen: make(map[featureHelpers]bool), local: local, }, nil } @@ -122,9 +115,13 @@ func (gen *Generator) generateFile(gf *protogen.GeneratedFile, file *protogen.Fi GeneratedFile: gf, Config: gen.cfg, LocalPackages: gen.local, - helpers: make(map[string]bool), } + 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) @@ -146,23 +143,19 @@ 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) + } + } } } 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/generator/pattern/LICENSE b/generator/pattern/LICENSE new file mode 100644 index 00000000..2645a8b7 --- /dev/null +++ b/generator/pattern/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Bob Matcuk + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/generator/pattern/match.go b/generator/pattern/match.go new file mode 100644 index 00000000..2074bf1e --- /dev/null +++ b/generator/pattern/match.go @@ -0,0 +1,457 @@ +package pattern + +import ( + "path" + "unicode/utf8" +) + +var ErrBadPattern = path.ErrBadPattern + +// Match reports whether name matches the shell pattern. +// The pattern syntax is: +// +// pattern: +// { term } +// term: +// '*' matches any sequence of non-path-separators +// '/**/' matches zero or more directories +// '?' matches any single non-path-separator character +// '[' [ '^' '!' ] { character-range } ']' +// character class (must be non-empty) +// starting with `^` or `!` negates the class +// '{' { term } [ ',' { term } ... ] '}' +// alternatives +// c matches character c (c != '*', '?', '\\', '[') +// '\\' c matches character c +// +// character-range: +// c matches character c (c != '\\', '-', ']') +// '\\' c matches character c +// lo '-' hi matches character c for lo <= c <= hi +// +// Match returns true if `name` matches the file name `pattern`. `name` and +// `pattern` are split on forward slash (`/`) characters and may be relative or +// absolute. +// +// Match requires pattern to match all of name, not just a substring. +// The only possible returned error is ErrBadPattern, when pattern +// is malformed. +// +// A doublestar (`**`) should appear surrounded by path separators such as +// `/**/`. A mid-pattern doublestar (`**`) behaves like bash's globstar +// option: a pattern such as `path/to/**.txt` would return the same results as +// `path/to/*.txt`. The pattern you're looking for is `path/to/**/*.txt`. +// +// Note: this is meant as a drop-in replacement for path.Match() which +// always uses '/' as the path separator. If you want to support systems +// which use a different path separator (such as Windows), what you want +// is PathMatch(). Alternatively, you can run filepath.ToSlash() on both +// pattern and name and then use this function. +// +// Note: users should _not_ count on the returned error, +// doublestar.ErrBadPattern, being equal to path.ErrBadPattern. +func Match(pattern, name string) (bool, error) { + return matchWithSeparator(pattern, name, '/', true) +} + +func matchWithSeparator(pattern, name string, separator rune, validate bool) (matched bool, err error) { + return doMatchWithSeparator(pattern, name, separator, validate, -1, -1, -1, -1, 0, 0) +} + +func doMatchWithSeparator(pattern, name string, separator rune, validate bool, doublestarPatternBacktrack, doublestarNameBacktrack, starPatternBacktrack, starNameBacktrack, patIdx, nameIdx int) (matched bool, err error) { + patLen := len(pattern) + nameLen := len(name) + startOfSegment := true +MATCH: + for nameIdx < nameLen { + if patIdx < patLen { + switch pattern[patIdx] { + case '*': + if patIdx++; patIdx < patLen && pattern[patIdx] == '*' { + // doublestar - must begin with a path separator, otherwise we'll + // treat it like a single star like bash + patIdx++ + if startOfSegment { + if patIdx >= patLen { + // pattern ends in `/**`: return true + return true, nil + } + + // doublestar must also end with a path separator, otherwise we're + // just going to treat the doublestar as a single star like bash + patRune, patRuneLen := utf8.DecodeRuneInString(pattern[patIdx:]) + if patRune == separator { + patIdx += patRuneLen + + doublestarPatternBacktrack = patIdx + doublestarNameBacktrack = nameIdx + starPatternBacktrack = -1 + starNameBacktrack = -1 + continue + } + } + } + startOfSegment = false + + starPatternBacktrack = patIdx + starNameBacktrack = nameIdx + continue + + case '?': + startOfSegment = false + nameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:]) + if nameRune == separator { + // `?` cannot match the separator + break + } + + patIdx++ + nameIdx += nameRuneLen + continue + + case '[': + startOfSegment = false + if patIdx++; patIdx >= patLen { + // class didn't end + return false, ErrBadPattern + } + nameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:]) + + matched := false + negate := pattern[patIdx] == '!' || pattern[patIdx] == '^' + if negate { + patIdx++ + } + + if patIdx >= patLen || pattern[patIdx] == ']' { + // class didn't end or empty character class + return false, ErrBadPattern + } + + last := utf8.MaxRune + for patIdx < patLen && pattern[patIdx] != ']' { + patRune, patRuneLen := utf8.DecodeRuneInString(pattern[patIdx:]) + patIdx += patRuneLen + + // match a range + if last < utf8.MaxRune && patRune == '-' && patIdx < patLen && pattern[patIdx] != ']' { + if pattern[patIdx] == '\\' { + // next character is escaped + patIdx++ + } + patRune, patRuneLen = utf8.DecodeRuneInString(pattern[patIdx:]) + patIdx += patRuneLen + + if last <= nameRune && nameRune <= patRune { + matched = true + break + } + + // didn't match range - reset `last` + last = utf8.MaxRune + continue + } + + // not a range - check if the next rune is escaped + if patRune == '\\' { + patRune, patRuneLen = utf8.DecodeRuneInString(pattern[patIdx:]) + patIdx += patRuneLen + } + + // check if the rune matches + if patRune == nameRune { + matched = true + break + } + + // no matches yet + last = patRune + } + + if matched == negate { + // failed to match - if we reached the end of the pattern, that means + // we never found a closing `]` + if patIdx >= patLen { + return false, ErrBadPattern + } + break + } + + closingIdx := indexUnescapedByte(pattern[patIdx:], ']', true) + if closingIdx == -1 { + // no closing `]` + return false, ErrBadPattern + } + + patIdx += closingIdx + 1 + nameIdx += nameRuneLen + continue + + case '{': + startOfSegment = false + beforeIdx := patIdx + patIdx++ + closingIdx := indexMatchedClosingAlt(pattern[patIdx:], separator != '\\') + if closingIdx == -1 { + // no closing `}` + return false, ErrBadPattern + } + closingIdx += patIdx + + for { + commaIdx := indexNextAlt(pattern[patIdx:closingIdx], separator != '\\') + if commaIdx == -1 { + break + } + commaIdx += patIdx + + result, err := doMatchWithSeparator(pattern[:beforeIdx]+pattern[patIdx:commaIdx]+pattern[closingIdx+1:], name, separator, validate, doublestarPatternBacktrack, doublestarNameBacktrack, starPatternBacktrack, starNameBacktrack, beforeIdx, nameIdx) + if result || err != nil { + return result, err + } + + patIdx = commaIdx + 1 + } + return doMatchWithSeparator(pattern[:beforeIdx]+pattern[patIdx:closingIdx]+pattern[closingIdx+1:], name, separator, validate, doublestarPatternBacktrack, doublestarNameBacktrack, starPatternBacktrack, starNameBacktrack, beforeIdx, nameIdx) + + case '\\': + if separator != '\\' { + // next rune is "escaped" in the pattern - literal match + if patIdx++; patIdx >= patLen { + // pattern ended + return false, ErrBadPattern + } + } + fallthrough + + default: + patRune, patRuneLen := utf8.DecodeRuneInString(pattern[patIdx:]) + nameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:]) + if patRune != nameRune { + if separator != '\\' && patIdx > 0 && pattern[patIdx-1] == '\\' { + // if this rune was meant to be escaped, we need to move patIdx + // back to the backslash before backtracking or validating below + patIdx-- + } + break + } + + patIdx += patRuneLen + nameIdx += nameRuneLen + startOfSegment = patRune == separator + continue + } + } + + if starPatternBacktrack >= 0 { + // `*` backtrack, but only if the `name` rune isn't the separator + nameRune, nameRuneLen := utf8.DecodeRuneInString(name[starNameBacktrack:]) + if nameRune != separator { + starNameBacktrack += nameRuneLen + patIdx = starPatternBacktrack + nameIdx = starNameBacktrack + startOfSegment = false + continue + } + } + + if doublestarPatternBacktrack >= 0 { + // `**` backtrack, advance `name` past next separator + nameIdx = doublestarNameBacktrack + for nameIdx < nameLen { + nameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:]) + nameIdx += nameRuneLen + if nameRune == separator { + doublestarNameBacktrack = nameIdx + patIdx = doublestarPatternBacktrack + startOfSegment = true + continue MATCH + } + } + } + + if validate && patIdx < patLen && !doValidatePattern(pattern[patIdx:], separator) { + return false, ErrBadPattern + } + return false, nil + } + + if nameIdx < nameLen { + // we reached the end of `pattern` before the end of `name` + return false, nil + } + + // we've reached the end of `name`; we've successfully matched if we've also + // reached the end of `pattern`, or if the rest of `pattern` can match a + // zero-length string + return isZeroLengthPattern(pattern[patIdx:], separator) +} + +func isZeroLengthPattern(pattern string, separator rune) (ret bool, err error) { + // `/**`, `**/`, and `/**/` are special cases - a pattern such as `path/to/a/**` or `path/to/a/**/` + // *should* match `path/to/a` because `a` might be a directory + if pattern == "" || + pattern == "*" || + pattern == "**" || + pattern == string(separator)+"**" || + pattern == "**"+string(separator) || + pattern == string(separator)+"**"+string(separator) { + return true, nil + } + + if pattern[0] == '{' { + closingIdx := indexMatchedClosingAlt(pattern[1:], separator != '\\') + if closingIdx == -1 { + // no closing '}' + return false, ErrBadPattern + } + closingIdx += 1 + + patIdx := 1 + for { + commaIdx := indexNextAlt(pattern[patIdx:closingIdx], separator != '\\') + if commaIdx == -1 { + break + } + commaIdx += patIdx + + ret, err = isZeroLengthPattern(pattern[patIdx:commaIdx]+pattern[closingIdx+1:], separator) + if ret || err != nil { + return + } + + patIdx = commaIdx + 1 + } + return isZeroLengthPattern(pattern[patIdx:closingIdx]+pattern[closingIdx+1:], separator) + } + + // no luck - validate the rest of the pattern + if !doValidatePattern(pattern, separator) { + return false, ErrBadPattern + } + return false, nil +} + +// Finds the next comma, but ignores any commas that appear inside nested `{}`. +// Assumes that each opening bracket has a corresponding closing bracket. +func indexNextAlt(s string, allowEscaping bool) int { + alts := 1 + l := len(s) + for i := 0; i < l; i++ { + if allowEscaping && s[i] == '\\' { + // skip next byte + i++ + } else if s[i] == '{' { + alts++ + } else if s[i] == '}' { + alts-- + } else if s[i] == ',' && alts == 1 { + return i + } + } + return -1 +} + +// Finds the index of the first unescaped byte `c`, or negative 1. +func indexUnescapedByte(s string, c byte, allowEscaping bool) int { + l := len(s) + for i := 0; i < l; i++ { + if allowEscaping && s[i] == '\\' { + // skip next byte + i++ + } else if s[i] == c { + return i + } + } + return -1 +} + +// Assuming the byte before the beginning of `s` is an opening `{`, this +// function will find the index of the matching `}`. That is, it'll skip over +// any nested `{}` and account for escaping +func indexMatchedClosingAlt(s string, allowEscaping bool) int { + alts := 1 + l := len(s) + for i := 0; i < l; i++ { + if allowEscaping && s[i] == '\\' { + // skip next byte + i++ + } else if s[i] == '{' { + alts++ + } else if s[i] == '}' { + if alts--; alts == 0 { + return i + } + } + } + return -1 +} + +// Validate a pattern. Patterns are validated while they run in Match(), +// PathMatch(), and Glob(), so, you normally wouldn't need to call this. +// However, there are cases where this might be useful: for example, if your +// program allows a user to enter a pattern that you'll run at a later time, +// you might want to validate it. +// +// ValidatePattern assumes your pattern uses '/' as the path separator. +func ValidatePattern(s string) bool { + return doValidatePattern(s, '/') +} + +func doValidatePattern(s string, separator rune) bool { + altDepth := 0 + l := len(s) +VALIDATE: + for i := 0; i < l; i++ { + switch s[i] { + case '\\': + if separator != '\\' { + // skip the next byte - return false if there is no next byte + if i++; i >= l { + return false + } + } + continue + + case '[': + if i++; i >= l { + // class didn't end + return false + } + if s[i] == '^' || s[i] == '!' { + i++ + } + if i >= l || s[i] == ']' { + // class didn't end or empty character class + return false + } + + for ; i < l; i++ { + if separator != '\\' && s[i] == '\\' { + i++ + } else if s[i] == ']' { + // looks good + continue VALIDATE + } + } + + // class didn't end + return false + + case '{': + altDepth++ + continue + + case '}': + if altDepth == 0 { + // alt end without a corresponding start + return false + } + altDepth-- + continue + } + } + + // valid as long as all alts are closed + return altDepth == 0 +} diff --git a/go.mod b/go.mod index ee3252c8..91c37af2 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.58.2 + 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 7315018a..378518bc 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.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 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= diff --git a/protohelpers/protohelpers.go b/protohelpers/protohelpers.go new file mode 100644 index 00000000..64bde83e --- /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 +} diff --git a/testproto/buildtag/empty/empty_vtproto.pb.go b/testproto/buildtag/empty/empty_vtproto.pb.go new file mode 100644 index 00000000..7a3e0d50 --- /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) +) diff --git a/testproto/empty/empty.pb.go b/testproto/empty/empty.pb.go index 972b3505..e8d0ab2f 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 64cb68ed..7f24b87d 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/grpc_vtproto.pb.go b/testproto/grpc/grpc_vtproto.pb.go index b0467116..38b30d2c 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.pb.go b/testproto/grpc/inner/inner.pb.go index c1734351..44f019e9 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/grpc/inner/inner_vtproto.pb.go b/testproto/grpc/inner/inner_vtproto.pb.go index 530a4887..31b69461 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.pb.go b/testproto/pool/pool.pb.go index 4f16badc..2952ef4d 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_vtproto.pb.go b/testproto/pool/pool_vtproto.pb.go index 510c66e9..5f3a5c9f 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,16 +636,20 @@ 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 } - m.Foo1 = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Foo1 = stringValue iNdEx = postIndex case 2: if wireType != 0 { @@ -757,7 +658,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 +677,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 +690,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 +708,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.pb.go b/testproto/pool/pool_with_oneof.pb.go index 615be678..338067ad 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_oneof_vtproto.pb.go b/testproto/pool/pool_with_oneof_vtproto.pb.go index 049dc2a4..1f95bddd 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,25 +1788,29 @@ 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 } - m.B = append(m.B, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.B = append(m.B, stringValue) 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 +1833,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 +1861,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 +1875,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 +1903,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 +1931,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 +1944,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 +1962,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 +1990,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 +2018,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 +2031,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 +2059,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 +2072,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 +2100,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 +2113,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 +2141,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 +2154,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 +2168,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.pb.go b/testproto/pool/pool_with_slice_reuse.pb.go index 6de4cf39..aca74380 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/pool/pool_with_slice_reuse_vtproto.pb.go b/testproto/pool/pool_with_slice_reuse_vtproto.pb.go index 441933be..530cb2e9 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,25 +1376,29 @@ 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 } - m.Sl = append(m.Sl, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Sl = append(m.Sl, stringValue) 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 +1421,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 +1449,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 +1462,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 +1485,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 +1513,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 +1541,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 +1554,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 +1573,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 +1589,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 +1604,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 +1618,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 +1640,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 +1660,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,16 +1674,20 @@ 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 } - m.C = append(m.C, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.C = append(m.C, stringValue) iNdEx = postIndex case 4: if wireType != 2 { @@ -1687,7 +1696,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 +1709,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 +1732,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,16 +1746,20 @@ 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 } - m.E = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.E = stringValue iNdEx = postIndex case 6: if wireType != 0 { @@ -1755,7 +1768,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 +1782,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 +1810,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 +1838,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 +1852,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.pb.go b/testproto/proto2/scalars.pb.go index 5157de68..ef66ef67 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/proto2/scalars_vtproto.pb.go b/testproto/proto2/scalars_vtproto.pb.go index 7d390c53..64685387 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,16 +10055,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.RequiredField = &s iNdEx = postIndex hasFields[0] |= uint64(0x00000001) @@ -10178,7 +10079,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,16 +10093,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalField = &s iNdEx = postIndex case 3: @@ -10211,7 +10116,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,25 +10130,29 @@ 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 } - m.RepeatedField = append(m.RepeatedField, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.RepeatedField = append(m.RepeatedField, stringValue) 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 +10179,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 +10207,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 +10220,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 +10239,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 +10252,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 +10270,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 +10283,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 +10296,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 +10328,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 +10356,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 +10377,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 +10395,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 +10412,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 +10425,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 +10442,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 +10464,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 +10481,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 +10494,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 +10511,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 +10530,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.pb.go b/testproto/proto3opt/opt.pb.go index 93a46d30..bfd77507 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/proto3opt/opt_vtproto.pb.go b/testproto/proto3opt/opt_vtproto.pb.go index 7ccb0d79..3df0d039 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,16 +1099,20 @@ 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 } - s := unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + s := stringValue m.OptionalString = &s iNdEx = postIndex case 15: @@ -1221,7 +1122,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 +1135,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 +1153,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 +1168,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.pb.go b/testproto/unsafe/unsafe.pb.go index e17dc000..f7a86f9c 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 @@ -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 31501896..59e5e0e4 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 179faed5..066e04d2 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) } @@ -94,7 +100,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 +128,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 +176,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 9534758d..d03d22e5 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" ) @@ -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 @@ -498,14 +583,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 +631,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 +640,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 +684,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 +751,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,11 +765,63 @@ 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 } +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 @@ -740,7 +877,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 +896,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 +915,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,22 +934,30 @@ 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++ +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 } - dAtA[offset] = uint8(v) - return base + return len(dAtA) - i, nil } func (m *UnsafeTest_Sub1) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { @@ -847,14 +992,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 +1040,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 +1049,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 +1093,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 +1165,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,11 +1179,63 @@ 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 } +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 @@ -1069,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 { @@ -1113,7 +1317,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 +1336,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 +1355,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,12 +1374,31 @@ 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 } 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 @@ -1184,11 +1407,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 +1426,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 +1449,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 +1478,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,9 +1488,27 @@ 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_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 @@ -1289,7 +1530,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 +1542,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 +1554,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,16 +1566,21 @@ 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_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) @@ -1344,7 +1590,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 +1618,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 +1632,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 +1650,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 +1663,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 +1679,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 +1707,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 +1735,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 +1749,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 +1767,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 +1780,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 +1794,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 +1822,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 +1850,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 +1863,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 +1882,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 +1899,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 +1913,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 +1928,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 +1942,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 +1956,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 +1973,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 +2001,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 +2029,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 +2043,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 +2061,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 +2074,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 +2089,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 @@ -1863,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 { @@ -1871,7 +2117,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 @@ -1886,20 +2132,20 @@ 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 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1912,38 +2158,216 @@ 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 } - 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 ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + 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++ @@ -1953,11 +2377,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 +2405,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 +2418,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 +2446,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 +2459,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 @@ -2056,14 +2480,55 @@ 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 := 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 +2543,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 +2551,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 +2579,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,16 +2593,20 @@ 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 } - m.S = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.S = stringValue iNdEx = postIndex case 2: if wireType != 2 { @@ -2232,7 +2615,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 +2628,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 +2641,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 +2669,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 +2697,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,16 +2711,20 @@ 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 } - m.S = append(m.S, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.S = append(m.S, stringValue) iNdEx = postIndex case 2: if wireType != 2 { @@ -2346,7 +2733,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 +2746,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 +2759,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 +2787,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 +2815,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 +2828,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 +2847,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 +2864,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,22 +2878,26 @@ 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 } - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } iNdEx = postStringIndexmapkey } else if fieldNum == 2 { 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 +2911,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 +2924,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 +2941,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 +2969,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 +2997,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,16 +3011,20 @@ 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 } - m.Foo = &UnsafeTest_Sub4_S{S: unsafe.String(&dAtA[iNdEx], intStringLen)} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Foo = &UnsafeTest_Sub4_S{S: stringValue} iNdEx = postIndex case 2: if wireType != 2 { @@ -2638,7 +3033,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 +3046,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 +3060,198 @@ 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 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_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 + } + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 + } + if intStringLenmapvalue == 0 { + mapvalue = "" + } else { + 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 ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2693,7 +3274,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 +3302,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 +3315,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 +3343,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 +3356,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 +3384,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 +3397,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 +3425,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 +3438,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 @@ -2878,14 +3459,55 @@ 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 := 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.pb.go b/testproto/wkt/wkt.pb.go index a20fd0e0..31d29a16 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 @@ -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(0) +} + 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 c3f32709..9e6b0584 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 7f83b5fd..9d1a84c2 100644 --- a/testproto/wkt/wkt_vtproto.pb.go +++ b/testproto/wkt/wkt_vtproto.pb.go @@ -6,10 +6,12 @@ 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" 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,10 +20,10 @@ 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" - bits "math/bits" ) const ( @@ -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,13 +167,54 @@ func (m *MessageWithWKT) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.NullValue != 0 { + i = protohelpers.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 = protohelpers.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 = protohelpers.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 = protohelpers.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 { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x72 } @@ -165,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 } @@ -175,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 } @@ -185,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 } @@ -195,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 } @@ -205,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 } @@ -215,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 } @@ -225,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 } @@ -235,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 } @@ -245,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 } @@ -255,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 } @@ -265,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 } @@ -275,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 } @@ -285,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 @@ -333,13 +381,54 @@ func (m *MessageWithWKT) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.NullValue != 0 { + i = protohelpers.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 = protohelpers.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 = protohelpers.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 = protohelpers.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 { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x72 } @@ -349,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 } @@ -359,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 } @@ -369,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 } @@ -379,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 } @@ -389,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 } @@ -399,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 } @@ -409,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 } @@ -419,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 } @@ -429,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 } @@ -439,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 } @@ -449,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 } @@ -459,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 } @@ -469,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 } @@ -484,70 +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 + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ValueValue != nil { + l = (*structpb1.Value)(m.ValueValue).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ListvalueValue != nil { + l = (*structpb1.ListValue)(m.ListvalueValue).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.NullValue != 0 { + 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 @@ -556,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 @@ -584,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 @@ -597,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 @@ -620,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 @@ -633,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 @@ -656,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 @@ -669,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 @@ -692,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 @@ -705,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 @@ -728,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 @@ -741,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 @@ -764,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 @@ -777,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 @@ -800,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 @@ -813,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 @@ -836,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 @@ -849,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 @@ -872,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 @@ -885,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 @@ -908,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 @@ -921,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 @@ -944,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 @@ -957,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 @@ -980,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 @@ -993,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 @@ -1016,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 @@ -1029,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 @@ -1052,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 @@ -1065,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 @@ -1081,114 +1179,155 @@ func (m *MessageWithWKT) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + 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 (iNdEx + skippy) > l { + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - 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 m.StructValue == nil { + m.StructValue = &structpb.Struct{} } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF + if err := (*structpb1.Struct)(m.StructValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueValue", wireType) } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { - return 0, io.ErrUnexpectedEOF + return io.ErrUnexpectedEOF } + b := dAtA[iNdEx] iNdEx++ - if dAtA[iNdEx-1] < 0x80 { + msglen |= int(b&0x7F) << shift + if b < 0x80 { break } } - case 1: - iNdEx += 8 - case 2: - var length int + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.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 0, ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { - return 0, io.ErrUnexpectedEOF + return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - length |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if length < 0 { - return 0, ErrInvalidLength + if msglen < 0 { + return protohelpers.ErrInvalidLength } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NullValue |= structpb.NullValue(b&0x7F) << shift + if b < 0x80 { + break + } } - 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 + 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 } } - 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") -) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MessageWithWKT) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1197,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 @@ -1225,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 @@ -1238,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 @@ -1261,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 @@ -1274,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 @@ -1297,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 @@ -1310,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 @@ -1333,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 @@ -1346,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 @@ -1369,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 @@ -1382,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 @@ -1405,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 @@ -1418,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 @@ -1441,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 @@ -1454,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 @@ -1477,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 @@ -1490,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 @@ -1513,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 @@ -1526,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 @@ -1549,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 @@ -1562,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 @@ -1585,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 @@ -1598,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 @@ -1621,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 @@ -1634,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 @@ -1657,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 @@ -1670,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 @@ -1693,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 @@ -1706,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 @@ -1722,14 +1861,141 @@ 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 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.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 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.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 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.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 protohelpers.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:]) + 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 aa499681..c99b9e61 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,16 +320,20 @@ 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 } - m.TypeUrl = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.TypeUrl = stringValue iNdEx = postIndex case 2: if wireType != 2 { @@ -441,7 +342,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 +355,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 +368,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 349e70f7..681ae9f7 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 07f7ac71..470c82ac 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 759b0216..9f52025d 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,25 +276,29 @@ 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 } - m.Paths = append(m.Paths, unsafe.String(&dAtA[iNdEx], intStringLen)) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Paths = append(m.Paths, stringValue) 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 new file mode 100644 index 00000000..835849e1 --- /dev/null +++ b/types/known/structpb/struct_vtproto.pb.go @@ -0,0 +1,1984 @@ +// 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" + 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" + 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 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 + +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] = (*structpb.Value)((*Value)(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 { + 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() *Value_NullValue { + if m == nil { + return (*Value_NullValue)(nil) + } + r := new(Value_NullValue) + r.NullValue = m.NullValue + return r +} + +func (m *Value_NumberValue) CloneVT() *Value_NumberValue { + if m == nil { + return (*Value_NumberValue)(nil) + } + r := new(Value_NumberValue) + r.NumberValue = m.NumberValue + return r +} + +func (m *Value_StringValue) CloneVT() *Value_StringValue { + if m == nil { + return (*Value_StringValue)(nil) + } + r := new(Value_StringValue) + r.StringValue = m.StringValue + return r +} + +func (m *Value_BoolValue) CloneVT() *Value_BoolValue { + if m == nil { + return (*Value_BoolValue)(nil) + } + r := new(Value_BoolValue) + r.BoolValue = m.BoolValue + return r +} + +func (m *Value_StructValue) CloneVT() *Value_StructValue { + if m == nil { + return (*Value_StructValue)(nil) + } + r := new(Value_StructValue) + r.StructValue = (*structpb.Struct)((*Struct)(m.StructValue).CloneVT()) + return r +} + +func (m *Value_ListValue) CloneVT() *Value_ListValue { + if m == nil { + return (*Value_ListValue)(nil) + } + r := new(Value_ListValue) + r.ListValue = (*structpb.ListValue)((*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] = (*structpb.Value)((*Value)(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 !(*Value)(p).EqualVT((*Value)(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 + } + 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 any) bool { + that, ok := thatIface.(*Value_NullValue) + if !ok { + if ot, ok := thatIface.(*structpb.Value_NullValue); ok { + that = (*Value_NullValue)(ot) + } else { + 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 any) bool { + that, ok := thatIface.(*Value_NumberValue) + if !ok { + if ot, ok := thatIface.(*structpb.Value_NumberValue); ok { + that = (*Value_NumberValue)(ot) + } else { + 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 any) bool { + that, ok := thatIface.(*Value_StringValue) + if !ok { + if ot, ok := thatIface.(*structpb.Value_StringValue); ok { + that = (*Value_StringValue)(ot) + } else { + 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 any) bool { + that, ok := thatIface.(*Value_BoolValue) + if !ok { + if ot, ok := thatIface.(*structpb.Value_BoolValue); ok { + that = (*Value_BoolValue)(ot) + } else { + 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 any) bool { + that, ok := thatIface.(*Value_StructValue) + if !ok { + if ot, ok := thatIface.(*structpb.Value_StructValue); ok { + that = (*Value_StructValue)(ot) + } else { + 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 !(*Struct)(p).EqualVT((*Struct)(q)) { + return false + } + } + return true +} + +func (this *Value_ListValue) EqualVT(thatIface any) bool { + that, ok := thatIface.(*Value_ListValue) + if !ok { + if ot, ok := thatIface.(*structpb.Value_ListValue); ok { + that = (*Value_ListValue)(ot) + } else { + 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 !(*ListValue)(p).EqualVT((*ListValue)(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 !(*Value)(p).EqualVT((*Value)(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 := (*Value)(v).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + 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 *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 + 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 + } + 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 = protohelpers.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 = protohelpers.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 := (*Struct)(m.StructValue).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 *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 := (*ListValue)(m.ListValue).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.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 := (*Value)(m.Values[iNdEx]).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +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 := (*Value)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + 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 *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 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 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 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 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 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 m, ok := m.Kind.(*structpb.Value_NullValue); ok { + msg := ((*Value_NullValue)(m)) + 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 = protohelpers.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 = protohelpers.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 := (*Struct)(m.StructValue).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 *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 := (*ListValue)(m.ListValue).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.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 := (*Value)(m.Values[iNdEx]).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.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 = (*Value)(v).SizeVT() + } + 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 +} + +func (m *Value) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + 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 +} + +func (m *Value_NullValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + protohelpers.SizeOfVarint(uint64(m.NullValue)) + return n +} +func (m *Value_NumberValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 9 + return n +} +func (m *Value_StringValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.StringValue) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *Value_BoolValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} +func (m *Value_StructValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StructValue != nil { + l = (*Struct)(m.StructValue).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Value_ListValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ListValue != nil { + l = (*ListValue)(m.ListValue).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(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 = (*Value)(e).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +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 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: 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 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.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 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 mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &structpb.Value{} + if err := (*Value)(mapvalue).UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } 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.Fields[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 + } + 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 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: 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 protohelpers.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 protohelpers.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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.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 protohelpers.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 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.Kind.(*structpb.Value_StructValue); ok { + if err := (*Struct)(oneof.StructValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.Struct{} + if err := (*Struct)(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 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.Kind.(*structpb.Value_ListValue); ok { + if err := (*ListValue)(oneof.ListValue).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.ListValue{} + if err := (*ListValue)(v).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &structpb.Value_ListValue{ListValue: v} + } + 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 + } + 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 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: 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 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 + } + m.Values = append(m.Values, &structpb.Value{}) + if err := (*Value)(m.Values[len(m.Values)-1]).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +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 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: 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 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.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 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 + } + if intStringLenmapkey == 0 { + mapkey = "" + } else { + 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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &structpb.Value{} + if err := (*Value)(mapvalue).UnmarshalVTUnsafe(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } 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.Fields[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 + } + 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 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: 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 protohelpers.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 protohelpers.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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Kind = &structpb.Value_StringValue{StringValue: stringValue} + 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 protohelpers.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 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.Kind.(*structpb.Value_StructValue); ok { + if err := (*Struct)(oneof.StructValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.Struct{} + if err := (*Struct)(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 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.Kind.(*structpb.Value_ListValue); ok { + if err := (*ListValue)(oneof.ListValue).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &structpb.ListValue{} + if err := (*ListValue)(v).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &structpb.Value_ListValue{ListValue: v} + } + 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 + } + 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 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: 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 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 + } + m.Values = append(m.Values, &structpb.Value{}) + if err := (*Value)(m.Values[len(m.Values)-1]).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/types/known/timestamppb/timestamp_vtproto.pb.go b/types/known/timestamppb/timestamp_vtproto.pb.go index 231bc659..5c63f308 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 8942b437..0dac9b28 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,25 +2121,29 @@ 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 } - m.Value = unsafe.String(&dAtA[iNdEx], intStringLen) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Value = stringValue 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 +2165,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 +2193,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 +2206,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 +2219,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 diff --git a/vtproto/ext.pb.go b/vtproto/ext.pb.go index b0f63a25..98c14a66 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