summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/protobuf/internal/impl/codec_gen.go')
-rw-r--r--vendor/google.golang.org/protobuf/internal/impl/codec_gen.go974
1 files changed, 487 insertions, 487 deletions
diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go
index ff198d0a1..1a509b63e 100644
--- a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go
+++ b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go
@@ -15,13 +15,13 @@ import (
)
// sizeBool returns the size of wire encoding a bool pointer as a Bool.
-func sizeBool(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBool(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Bool()
return f.tagsize + protowire.SizeVarint(protowire.EncodeBool(v))
}
// appendBool wire encodes a bool pointer as a Bool.
-func appendBool(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBool(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Bool()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, protowire.EncodeBool(v))
@@ -29,7 +29,7 @@ func appendBool(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byt
}
// consumeBool wire decodes a bool pointer as a Bool.
-func consumeBool(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBool(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -45,7 +45,7 @@ func consumeBool(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Bool() = protowire.DecodeBool(v)
out.n = n
@@ -61,7 +61,7 @@ var coderBool = pointerCoderFuncs{
// sizeBoolNoZero returns the size of wire encoding a bool pointer as a Bool.
// The zero value is not encoded.
-func sizeBoolNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBoolNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Bool()
if v == false {
return 0
@@ -71,7 +71,7 @@ func sizeBoolNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
// appendBoolNoZero wire encodes a bool pointer as a Bool.
// The zero value is not encoded.
-func appendBoolNoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBoolNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Bool()
if v == false {
return b, nil
@@ -90,14 +90,14 @@ var coderBoolNoZero = pointerCoderFuncs{
// sizeBoolPtr returns the size of wire encoding a *bool pointer as a Bool.
// It panics if the pointer is nil.
-func sizeBoolPtr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBoolPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.BoolPtr()
return f.tagsize + protowire.SizeVarint(protowire.EncodeBool(v))
}
// appendBoolPtr wire encodes a *bool pointer as a Bool.
// It panics if the pointer is nil.
-func appendBoolPtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBoolPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.BoolPtr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, protowire.EncodeBool(v))
@@ -105,7 +105,7 @@ func appendBoolPtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]
}
// consumeBoolPtr wire decodes a *bool pointer as a Bool.
-func consumeBoolPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBoolPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -121,7 +121,7 @@ func consumeBoolPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo,
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.BoolPtr()
if *vp == nil {
@@ -140,7 +140,7 @@ var coderBoolPtr = pointerCoderFuncs{
}
// sizeBoolSlice returns the size of wire encoding a []bool pointer as a repeated Bool.
-func sizeBoolSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBoolSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.BoolSlice()
for _, v := range s {
size += f.tagsize + protowire.SizeVarint(protowire.EncodeBool(v))
@@ -149,7 +149,7 @@ func sizeBoolSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
}
// appendBoolSlice encodes a []bool pointer as a repeated Bool.
-func appendBoolSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBoolSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.BoolSlice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -159,13 +159,13 @@ func appendBoolSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) (
}
// consumeBoolSlice wire decodes a []bool pointer as a repeated Bool.
-func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.BoolSlice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -180,7 +180,7 @@ func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, protowire.DecodeBool(v))
b = b[n:]
@@ -204,7 +204,7 @@ func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, protowire.DecodeBool(v))
out.n = n
@@ -219,7 +219,7 @@ var coderBoolSlice = pointerCoderFuncs{
}
// sizeBoolPackedSlice returns the size of wire encoding a []bool pointer as a packed repeated Bool.
-func sizeBoolPackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBoolPackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.BoolSlice()
if len(s) == 0 {
return 0
@@ -232,7 +232,7 @@ func sizeBoolPackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size i
}
// appendBoolPackedSlice encodes a []bool pointer as a packed repeated Bool.
-func appendBoolPackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBoolPackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.BoolSlice()
if len(s) == 0 {
return b, nil
@@ -257,19 +257,19 @@ var coderBoolPackedSlice = pointerCoderFuncs{
}
// sizeBoolValue returns the size of wire encoding a bool value as a Bool.
-func sizeBoolValue(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeBoolValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(protowire.EncodeBool(v.Bool()))
}
// appendBoolValue encodes a bool value as a Bool.
-func appendBoolValue(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendBoolValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, protowire.EncodeBool(v.Bool()))
return b, nil
}
// consumeBoolValue decodes a bool value as a Bool.
-func consumeBoolValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeBoolValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -285,7 +285,7 @@ func consumeBoolValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp p
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfBool(protowire.DecodeBool(v)), out, nil
@@ -299,7 +299,7 @@ var coderBoolValue = valueCoderFuncs{
}
// sizeBoolSliceValue returns the size of wire encoding a []bool value as a repeated Bool.
-func sizeBoolSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeBoolSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -309,7 +309,7 @@ func sizeBoolSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions)
}
// appendBoolSliceValue encodes a []bool value as a repeated Bool.
-func appendBoolSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendBoolSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -320,12 +320,12 @@ func appendBoolSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _
}
// consumeBoolSliceValue wire decodes a []bool value as a repeated Bool.
-func consumeBoolSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeBoolSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -340,7 +340,7 @@ func consumeBoolSliceValue(b []byte, listv protoreflect.Value, _ protowire.Numbe
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfBool(protowire.DecodeBool(v)))
b = b[n:]
@@ -363,7 +363,7 @@ func consumeBoolSliceValue(b []byte, listv protoreflect.Value, _ protowire.Numbe
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfBool(protowire.DecodeBool(v)))
out.n = n
@@ -378,7 +378,7 @@ var coderBoolSliceValue = valueCoderFuncs{
}
// sizeBoolPackedSliceValue returns the size of wire encoding a []bool value as a packed repeated Bool.
-func sizeBoolPackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeBoolPackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -393,7 +393,7 @@ func sizeBoolPackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOp
}
// appendBoolPackedSliceValue encodes a []bool value as a packed repeated Bool.
-func appendBoolPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendBoolPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -421,19 +421,19 @@ var coderBoolPackedSliceValue = valueCoderFuncs{
}
// sizeEnumValue returns the size of wire encoding a value as a Enum.
-func sizeEnumValue(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeEnumValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(uint64(v.Enum()))
}
// appendEnumValue encodes a value as a Enum.
-func appendEnumValue(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendEnumValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, uint64(v.Enum()))
return b, nil
}
// consumeEnumValue decodes a value as a Enum.
-func consumeEnumValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeEnumValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -449,7 +449,7 @@ func consumeEnumValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp p
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfEnum(protoreflect.EnumNumber(v)), out, nil
@@ -463,7 +463,7 @@ var coderEnumValue = valueCoderFuncs{
}
// sizeEnumSliceValue returns the size of wire encoding a [] value as a repeated Enum.
-func sizeEnumSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeEnumSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -473,7 +473,7 @@ func sizeEnumSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions)
}
// appendEnumSliceValue encodes a [] value as a repeated Enum.
-func appendEnumSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendEnumSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -484,12 +484,12 @@ func appendEnumSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _
}
// consumeEnumSliceValue wire decodes a [] value as a repeated Enum.
-func consumeEnumSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeEnumSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -504,7 +504,7 @@ func consumeEnumSliceValue(b []byte, listv protoreflect.Value, _ protowire.Numbe
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfEnum(protoreflect.EnumNumber(v)))
b = b[n:]
@@ -527,7 +527,7 @@ func consumeEnumSliceValue(b []byte, listv protoreflect.Value, _ protowire.Numbe
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfEnum(protoreflect.EnumNumber(v)))
out.n = n
@@ -542,7 +542,7 @@ var coderEnumSliceValue = valueCoderFuncs{
}
// sizeEnumPackedSliceValue returns the size of wire encoding a [] value as a packed repeated Enum.
-func sizeEnumPackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeEnumPackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -557,7 +557,7 @@ func sizeEnumPackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOp
}
// appendEnumPackedSliceValue encodes a [] value as a packed repeated Enum.
-func appendEnumPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendEnumPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -585,13 +585,13 @@ var coderEnumPackedSliceValue = valueCoderFuncs{
}
// sizeInt32 returns the size of wire encoding a int32 pointer as a Int32.
-func sizeInt32(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int32()
return f.tagsize + protowire.SizeVarint(uint64(v))
}
// appendInt32 wire encodes a int32 pointer as a Int32.
-func appendInt32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int32()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(v))
@@ -599,7 +599,7 @@ func appendInt32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]by
}
// consumeInt32 wire decodes a int32 pointer as a Int32.
-func consumeInt32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeInt32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -615,7 +615,7 @@ func consumeInt32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Int32() = int32(v)
out.n = n
@@ -631,7 +631,7 @@ var coderInt32 = pointerCoderFuncs{
// sizeInt32NoZero returns the size of wire encoding a int32 pointer as a Int32.
// The zero value is not encoded.
-func sizeInt32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int32()
if v == 0 {
return 0
@@ -641,7 +641,7 @@ func sizeInt32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendInt32NoZero wire encodes a int32 pointer as a Int32.
// The zero value is not encoded.
-func appendInt32NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int32()
if v == 0 {
return b, nil
@@ -660,14 +660,14 @@ var coderInt32NoZero = pointerCoderFuncs{
// sizeInt32Ptr returns the size of wire encoding a *int32 pointer as a Int32.
// It panics if the pointer is nil.
-func sizeInt32Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.Int32Ptr()
return f.tagsize + protowire.SizeVarint(uint64(v))
}
// appendInt32Ptr wire encodes a *int32 pointer as a Int32.
// It panics if the pointer is nil.
-func appendInt32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Int32Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(v))
@@ -675,7 +675,7 @@ func appendInt32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([
}
// consumeInt32Ptr wire decodes a *int32 pointer as a Int32.
-func consumeInt32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeInt32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -691,7 +691,7 @@ func consumeInt32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Int32Ptr()
if *vp == nil {
@@ -710,7 +710,7 @@ var coderInt32Ptr = pointerCoderFuncs{
}
// sizeInt32Slice returns the size of wire encoding a []int32 pointer as a repeated Int32.
-func sizeInt32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int32Slice()
for _, v := range s {
size += f.tagsize + protowire.SizeVarint(uint64(v))
@@ -719,7 +719,7 @@ func sizeInt32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
}
// appendInt32Slice encodes a []int32 pointer as a repeated Int32.
-func appendInt32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int32Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -729,13 +729,13 @@ func appendInt32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeInt32Slice wire decodes a []int32 pointer as a repeated Int32.
-func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Int32Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -750,7 +750,7 @@ func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldIn
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, int32(v))
b = b[n:]
@@ -774,7 +774,7 @@ func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldIn
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, int32(v))
out.n = n
@@ -789,7 +789,7 @@ var coderInt32Slice = pointerCoderFuncs{
}
// sizeInt32PackedSlice returns the size of wire encoding a []int32 pointer as a packed repeated Int32.
-func sizeInt32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int32Slice()
if len(s) == 0 {
return 0
@@ -802,7 +802,7 @@ func sizeInt32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendInt32PackedSlice encodes a []int32 pointer as a packed repeated Int32.
-func appendInt32PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int32Slice()
if len(s) == 0 {
return b, nil
@@ -827,19 +827,19 @@ var coderInt32PackedSlice = pointerCoderFuncs{
}
// sizeInt32Value returns the size of wire encoding a int32 value as a Int32.
-func sizeInt32Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeInt32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(uint64(int32(v.Int())))
}
// appendInt32Value encodes a int32 value as a Int32.
-func appendInt32Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendInt32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, uint64(int32(v.Int())))
return b, nil
}
// consumeInt32Value decodes a int32 value as a Int32.
-func consumeInt32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeInt32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -855,7 +855,7 @@ func consumeInt32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfInt32(int32(v)), out, nil
@@ -869,7 +869,7 @@ var coderInt32Value = valueCoderFuncs{
}
// sizeInt32SliceValue returns the size of wire encoding a []int32 value as a repeated Int32.
-func sizeInt32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeInt32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -879,7 +879,7 @@ func sizeInt32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions
}
// appendInt32SliceValue encodes a []int32 value as a repeated Int32.
-func appendInt32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendInt32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -890,12 +890,12 @@ func appendInt32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _
}
// consumeInt32SliceValue wire decodes a []int32 value as a repeated Int32.
-func consumeInt32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeInt32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -910,7 +910,7 @@ func consumeInt32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Numb
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt32(int32(v)))
b = b[n:]
@@ -933,7 +933,7 @@ func consumeInt32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Numb
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt32(int32(v)))
out.n = n
@@ -948,7 +948,7 @@ var coderInt32SliceValue = valueCoderFuncs{
}
// sizeInt32PackedSliceValue returns the size of wire encoding a []int32 value as a packed repeated Int32.
-func sizeInt32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeInt32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -963,7 +963,7 @@ func sizeInt32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalO
}
// appendInt32PackedSliceValue encodes a []int32 value as a packed repeated Int32.
-func appendInt32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendInt32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -991,13 +991,13 @@ var coderInt32PackedSliceValue = valueCoderFuncs{
}
// sizeSint32 returns the size of wire encoding a int32 pointer as a Sint32.
-func sizeSint32(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int32()
return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(v)))
}
// appendSint32 wire encodes a int32 pointer as a Sint32.
-func appendSint32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int32()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(v)))
@@ -1005,7 +1005,7 @@ func appendSint32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]b
}
// consumeSint32 wire decodes a int32 pointer as a Sint32.
-func consumeSint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -1021,7 +1021,7 @@ func consumeSint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo,
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Int32() = int32(protowire.DecodeZigZag(v & math.MaxUint32))
out.n = n
@@ -1037,7 +1037,7 @@ var coderSint32 = pointerCoderFuncs{
// sizeSint32NoZero returns the size of wire encoding a int32 pointer as a Sint32.
// The zero value is not encoded.
-func sizeSint32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int32()
if v == 0 {
return 0
@@ -1047,7 +1047,7 @@ func sizeSint32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendSint32NoZero wire encodes a int32 pointer as a Sint32.
// The zero value is not encoded.
-func appendSint32NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int32()
if v == 0 {
return b, nil
@@ -1066,14 +1066,14 @@ var coderSint32NoZero = pointerCoderFuncs{
// sizeSint32Ptr returns the size of wire encoding a *int32 pointer as a Sint32.
// It panics if the pointer is nil.
-func sizeSint32Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.Int32Ptr()
return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(v)))
}
// appendSint32Ptr wire encodes a *int32 pointer as a Sint32.
// It panics if the pointer is nil.
-func appendSint32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Int32Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(v)))
@@ -1081,7 +1081,7 @@ func appendSint32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) (
}
// consumeSint32Ptr wire decodes a *int32 pointer as a Sint32.
-func consumeSint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -1097,7 +1097,7 @@ func consumeSint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Int32Ptr()
if *vp == nil {
@@ -1116,7 +1116,7 @@ var coderSint32Ptr = pointerCoderFuncs{
}
// sizeSint32Slice returns the size of wire encoding a []int32 pointer as a repeated Sint32.
-func sizeSint32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int32Slice()
for _, v := range s {
size += f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(v)))
@@ -1125,7 +1125,7 @@ func sizeSint32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
}
// appendSint32Slice encodes a []int32 pointer as a repeated Sint32.
-func appendSint32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int32Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -1135,13 +1135,13 @@ func appendSint32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeSint32Slice wire decodes a []int32 pointer as a repeated Sint32.
-func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Int32Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -1156,7 +1156,7 @@ func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, int32(protowire.DecodeZigZag(v&math.MaxUint32)))
b = b[n:]
@@ -1180,7 +1180,7 @@ func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, int32(protowire.DecodeZigZag(v&math.MaxUint32)))
out.n = n
@@ -1195,7 +1195,7 @@ var coderSint32Slice = pointerCoderFuncs{
}
// sizeSint32PackedSlice returns the size of wire encoding a []int32 pointer as a packed repeated Sint32.
-func sizeSint32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int32Slice()
if len(s) == 0 {
return 0
@@ -1208,7 +1208,7 @@ func sizeSint32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendSint32PackedSlice encodes a []int32 pointer as a packed repeated Sint32.
-func appendSint32PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int32Slice()
if len(s) == 0 {
return b, nil
@@ -1233,19 +1233,19 @@ var coderSint32PackedSlice = pointerCoderFuncs{
}
// sizeSint32Value returns the size of wire encoding a int32 value as a Sint32.
-func sizeSint32Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeSint32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int()))))
}
// appendSint32Value encodes a int32 value as a Sint32.
-func appendSint32Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSint32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(int32(v.Int()))))
return b, nil
}
// consumeSint32Value decodes a int32 value as a Sint32.
-func consumeSint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -1261,7 +1261,7 @@ func consumeSint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32))), out, nil
@@ -1275,7 +1275,7 @@ var coderSint32Value = valueCoderFuncs{
}
// sizeSint32SliceValue returns the size of wire encoding a []int32 value as a repeated Sint32.
-func sizeSint32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSint32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -1285,7 +1285,7 @@ func sizeSint32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOption
}
// appendSint32SliceValue encodes a []int32 value as a repeated Sint32.
-func appendSint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -1296,12 +1296,12 @@ func appendSint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeSint32SliceValue wire decodes a []int32 value as a repeated Sint32.
-func consumeSint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -1316,7 +1316,7 @@ func consumeSint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32))))
b = b[n:]
@@ -1339,7 +1339,7 @@ func consumeSint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32))))
out.n = n
@@ -1354,7 +1354,7 @@ var coderSint32SliceValue = valueCoderFuncs{
}
// sizeSint32PackedSliceValue returns the size of wire encoding a []int32 value as a packed repeated Sint32.
-func sizeSint32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSint32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -1369,7 +1369,7 @@ func sizeSint32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshal
}
// appendSint32PackedSliceValue encodes a []int32 value as a packed repeated Sint32.
-func appendSint32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSint32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -1397,13 +1397,13 @@ var coderSint32PackedSliceValue = valueCoderFuncs{
}
// sizeUint32 returns the size of wire encoding a uint32 pointer as a Uint32.
-func sizeUint32(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Uint32()
return f.tagsize + protowire.SizeVarint(uint64(v))
}
// appendUint32 wire encodes a uint32 pointer as a Uint32.
-func appendUint32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint32()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(v))
@@ -1411,7 +1411,7 @@ func appendUint32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]b
}
// consumeUint32 wire decodes a uint32 pointer as a Uint32.
-func consumeUint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeUint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -1427,7 +1427,7 @@ func consumeUint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo,
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Uint32() = uint32(v)
out.n = n
@@ -1443,7 +1443,7 @@ var coderUint32 = pointerCoderFuncs{
// sizeUint32NoZero returns the size of wire encoding a uint32 pointer as a Uint32.
// The zero value is not encoded.
-func sizeUint32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Uint32()
if v == 0 {
return 0
@@ -1453,7 +1453,7 @@ func sizeUint32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendUint32NoZero wire encodes a uint32 pointer as a Uint32.
// The zero value is not encoded.
-func appendUint32NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint32()
if v == 0 {
return b, nil
@@ -1472,14 +1472,14 @@ var coderUint32NoZero = pointerCoderFuncs{
// sizeUint32Ptr returns the size of wire encoding a *uint32 pointer as a Uint32.
// It panics if the pointer is nil.
-func sizeUint32Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.Uint32Ptr()
return f.tagsize + protowire.SizeVarint(uint64(v))
}
// appendUint32Ptr wire encodes a *uint32 pointer as a Uint32.
// It panics if the pointer is nil.
-func appendUint32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Uint32Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(v))
@@ -1487,7 +1487,7 @@ func appendUint32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) (
}
// consumeUint32Ptr wire decodes a *uint32 pointer as a Uint32.
-func consumeUint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeUint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -1503,7 +1503,7 @@ func consumeUint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Uint32Ptr()
if *vp == nil {
@@ -1522,7 +1522,7 @@ var coderUint32Ptr = pointerCoderFuncs{
}
// sizeUint32Slice returns the size of wire encoding a []uint32 pointer as a repeated Uint32.
-func sizeUint32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint32Slice()
for _, v := range s {
size += f.tagsize + protowire.SizeVarint(uint64(v))
@@ -1531,7 +1531,7 @@ func sizeUint32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
}
// appendUint32Slice encodes a []uint32 pointer as a repeated Uint32.
-func appendUint32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint32Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -1541,13 +1541,13 @@ func appendUint32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeUint32Slice wire decodes a []uint32 pointer as a repeated Uint32.
-func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Uint32Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -1562,7 +1562,7 @@ func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, uint32(v))
b = b[n:]
@@ -1586,7 +1586,7 @@ func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, uint32(v))
out.n = n
@@ -1601,7 +1601,7 @@ var coderUint32Slice = pointerCoderFuncs{
}
// sizeUint32PackedSlice returns the size of wire encoding a []uint32 pointer as a packed repeated Uint32.
-func sizeUint32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint32Slice()
if len(s) == 0 {
return 0
@@ -1614,7 +1614,7 @@ func sizeUint32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendUint32PackedSlice encodes a []uint32 pointer as a packed repeated Uint32.
-func appendUint32PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint32Slice()
if len(s) == 0 {
return b, nil
@@ -1639,19 +1639,19 @@ var coderUint32PackedSlice = pointerCoderFuncs{
}
// sizeUint32Value returns the size of wire encoding a uint32 value as a Uint32.
-func sizeUint32Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeUint32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(uint64(uint32(v.Uint())))
}
// appendUint32Value encodes a uint32 value as a Uint32.
-func appendUint32Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendUint32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, uint64(uint32(v.Uint())))
return b, nil
}
// consumeUint32Value decodes a uint32 value as a Uint32.
-func consumeUint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeUint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -1667,7 +1667,7 @@ func consumeUint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfUint32(uint32(v)), out, nil
@@ -1681,7 +1681,7 @@ var coderUint32Value = valueCoderFuncs{
}
// sizeUint32SliceValue returns the size of wire encoding a []uint32 value as a repeated Uint32.
-func sizeUint32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeUint32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -1691,7 +1691,7 @@ func sizeUint32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOption
}
// appendUint32SliceValue encodes a []uint32 value as a repeated Uint32.
-func appendUint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendUint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -1702,12 +1702,12 @@ func appendUint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeUint32SliceValue wire decodes a []uint32 value as a repeated Uint32.
-func consumeUint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeUint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -1722,7 +1722,7 @@ func consumeUint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint32(uint32(v)))
b = b[n:]
@@ -1745,7 +1745,7 @@ func consumeUint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint32(uint32(v)))
out.n = n
@@ -1760,7 +1760,7 @@ var coderUint32SliceValue = valueCoderFuncs{
}
// sizeUint32PackedSliceValue returns the size of wire encoding a []uint32 value as a packed repeated Uint32.
-func sizeUint32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeUint32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -1775,7 +1775,7 @@ func sizeUint32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshal
}
// appendUint32PackedSliceValue encodes a []uint32 value as a packed repeated Uint32.
-func appendUint32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendUint32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -1803,13 +1803,13 @@ var coderUint32PackedSliceValue = valueCoderFuncs{
}
// sizeInt64 returns the size of wire encoding a int64 pointer as a Int64.
-func sizeInt64(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int64()
return f.tagsize + protowire.SizeVarint(uint64(v))
}
// appendInt64 wire encodes a int64 pointer as a Int64.
-func appendInt64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int64()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(v))
@@ -1817,7 +1817,7 @@ func appendInt64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]by
}
// consumeInt64 wire decodes a int64 pointer as a Int64.
-func consumeInt64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeInt64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -1833,7 +1833,7 @@ func consumeInt64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Int64() = int64(v)
out.n = n
@@ -1849,7 +1849,7 @@ var coderInt64 = pointerCoderFuncs{
// sizeInt64NoZero returns the size of wire encoding a int64 pointer as a Int64.
// The zero value is not encoded.
-func sizeInt64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int64()
if v == 0 {
return 0
@@ -1859,7 +1859,7 @@ func sizeInt64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendInt64NoZero wire encodes a int64 pointer as a Int64.
// The zero value is not encoded.
-func appendInt64NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int64()
if v == 0 {
return b, nil
@@ -1878,14 +1878,14 @@ var coderInt64NoZero = pointerCoderFuncs{
// sizeInt64Ptr returns the size of wire encoding a *int64 pointer as a Int64.
// It panics if the pointer is nil.
-func sizeInt64Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.Int64Ptr()
return f.tagsize + protowire.SizeVarint(uint64(v))
}
// appendInt64Ptr wire encodes a *int64 pointer as a Int64.
// It panics if the pointer is nil.
-func appendInt64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Int64Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(v))
@@ -1893,7 +1893,7 @@ func appendInt64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([
}
// consumeInt64Ptr wire decodes a *int64 pointer as a Int64.
-func consumeInt64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeInt64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -1909,7 +1909,7 @@ func consumeInt64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Int64Ptr()
if *vp == nil {
@@ -1928,7 +1928,7 @@ var coderInt64Ptr = pointerCoderFuncs{
}
// sizeInt64Slice returns the size of wire encoding a []int64 pointer as a repeated Int64.
-func sizeInt64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int64Slice()
for _, v := range s {
size += f.tagsize + protowire.SizeVarint(uint64(v))
@@ -1937,7 +1937,7 @@ func sizeInt64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
}
// appendInt64Slice encodes a []int64 pointer as a repeated Int64.
-func appendInt64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int64Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -1947,13 +1947,13 @@ func appendInt64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeInt64Slice wire decodes a []int64 pointer as a repeated Int64.
-func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Int64Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -1968,7 +1968,7 @@ func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldIn
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, int64(v))
b = b[n:]
@@ -1992,7 +1992,7 @@ func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldIn
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, int64(v))
out.n = n
@@ -2007,7 +2007,7 @@ var coderInt64Slice = pointerCoderFuncs{
}
// sizeInt64PackedSlice returns the size of wire encoding a []int64 pointer as a packed repeated Int64.
-func sizeInt64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeInt64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int64Slice()
if len(s) == 0 {
return 0
@@ -2020,7 +2020,7 @@ func sizeInt64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendInt64PackedSlice encodes a []int64 pointer as a packed repeated Int64.
-func appendInt64PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendInt64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int64Slice()
if len(s) == 0 {
return b, nil
@@ -2045,19 +2045,19 @@ var coderInt64PackedSlice = pointerCoderFuncs{
}
// sizeInt64Value returns the size of wire encoding a int64 value as a Int64.
-func sizeInt64Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeInt64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(uint64(v.Int()))
}
// appendInt64Value encodes a int64 value as a Int64.
-func appendInt64Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendInt64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, uint64(v.Int()))
return b, nil
}
// consumeInt64Value decodes a int64 value as a Int64.
-func consumeInt64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeInt64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -2073,7 +2073,7 @@ func consumeInt64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfInt64(int64(v)), out, nil
@@ -2087,7 +2087,7 @@ var coderInt64Value = valueCoderFuncs{
}
// sizeInt64SliceValue returns the size of wire encoding a []int64 value as a repeated Int64.
-func sizeInt64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeInt64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -2097,7 +2097,7 @@ func sizeInt64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions
}
// appendInt64SliceValue encodes a []int64 value as a repeated Int64.
-func appendInt64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendInt64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -2108,12 +2108,12 @@ func appendInt64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _
}
// consumeInt64SliceValue wire decodes a []int64 value as a repeated Int64.
-func consumeInt64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeInt64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -2128,7 +2128,7 @@ func consumeInt64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Numb
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt64(int64(v)))
b = b[n:]
@@ -2151,7 +2151,7 @@ func consumeInt64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Numb
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt64(int64(v)))
out.n = n
@@ -2166,7 +2166,7 @@ var coderInt64SliceValue = valueCoderFuncs{
}
// sizeInt64PackedSliceValue returns the size of wire encoding a []int64 value as a packed repeated Int64.
-func sizeInt64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeInt64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -2181,7 +2181,7 @@ func sizeInt64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalO
}
// appendInt64PackedSliceValue encodes a []int64 value as a packed repeated Int64.
-func appendInt64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendInt64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -2209,13 +2209,13 @@ var coderInt64PackedSliceValue = valueCoderFuncs{
}
// sizeSint64 returns the size of wire encoding a int64 pointer as a Sint64.
-func sizeSint64(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int64()
return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v))
}
// appendSint64 wire encodes a int64 pointer as a Sint64.
-func appendSint64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int64()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, protowire.EncodeZigZag(v))
@@ -2223,7 +2223,7 @@ func appendSint64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]b
}
// consumeSint64 wire decodes a int64 pointer as a Sint64.
-func consumeSint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -2239,7 +2239,7 @@ func consumeSint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo,
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Int64() = protowire.DecodeZigZag(v)
out.n = n
@@ -2255,7 +2255,7 @@ var coderSint64 = pointerCoderFuncs{
// sizeSint64NoZero returns the size of wire encoding a int64 pointer as a Sint64.
// The zero value is not encoded.
-func sizeSint64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int64()
if v == 0 {
return 0
@@ -2265,7 +2265,7 @@ func sizeSint64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendSint64NoZero wire encodes a int64 pointer as a Sint64.
// The zero value is not encoded.
-func appendSint64NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int64()
if v == 0 {
return b, nil
@@ -2284,14 +2284,14 @@ var coderSint64NoZero = pointerCoderFuncs{
// sizeSint64Ptr returns the size of wire encoding a *int64 pointer as a Sint64.
// It panics if the pointer is nil.
-func sizeSint64Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.Int64Ptr()
return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v))
}
// appendSint64Ptr wire encodes a *int64 pointer as a Sint64.
// It panics if the pointer is nil.
-func appendSint64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Int64Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, protowire.EncodeZigZag(v))
@@ -2299,7 +2299,7 @@ func appendSint64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) (
}
// consumeSint64Ptr wire decodes a *int64 pointer as a Sint64.
-func consumeSint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -2315,7 +2315,7 @@ func consumeSint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Int64Ptr()
if *vp == nil {
@@ -2334,7 +2334,7 @@ var coderSint64Ptr = pointerCoderFuncs{
}
// sizeSint64Slice returns the size of wire encoding a []int64 pointer as a repeated Sint64.
-func sizeSint64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int64Slice()
for _, v := range s {
size += f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v))
@@ -2343,7 +2343,7 @@ func sizeSint64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
}
// appendSint64Slice encodes a []int64 pointer as a repeated Sint64.
-func appendSint64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int64Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -2353,13 +2353,13 @@ func appendSint64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeSint64Slice wire decodes a []int64 pointer as a repeated Sint64.
-func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Int64Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -2374,7 +2374,7 @@ func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, protowire.DecodeZigZag(v))
b = b[n:]
@@ -2398,7 +2398,7 @@ func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, protowire.DecodeZigZag(v))
out.n = n
@@ -2413,7 +2413,7 @@ var coderSint64Slice = pointerCoderFuncs{
}
// sizeSint64PackedSlice returns the size of wire encoding a []int64 pointer as a packed repeated Sint64.
-func sizeSint64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSint64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int64Slice()
if len(s) == 0 {
return 0
@@ -2426,7 +2426,7 @@ func sizeSint64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendSint64PackedSlice encodes a []int64 pointer as a packed repeated Sint64.
-func appendSint64PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSint64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int64Slice()
if len(s) == 0 {
return b, nil
@@ -2451,19 +2451,19 @@ var coderSint64PackedSlice = pointerCoderFuncs{
}
// sizeSint64Value returns the size of wire encoding a int64 value as a Sint64.
-func sizeSint64Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeSint64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v.Int()))
}
// appendSint64Value encodes a int64 value as a Sint64.
-func appendSint64Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSint64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, protowire.EncodeZigZag(v.Int()))
return b, nil
}
// consumeSint64Value decodes a int64 value as a Sint64.
-func consumeSint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -2479,7 +2479,7 @@ func consumeSint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfInt64(protowire.DecodeZigZag(v)), out, nil
@@ -2493,7 +2493,7 @@ var coderSint64Value = valueCoderFuncs{
}
// sizeSint64SliceValue returns the size of wire encoding a []int64 value as a repeated Sint64.
-func sizeSint64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSint64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -2503,7 +2503,7 @@ func sizeSint64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOption
}
// appendSint64SliceValue encodes a []int64 value as a repeated Sint64.
-func appendSint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -2514,12 +2514,12 @@ func appendSint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeSint64SliceValue wire decodes a []int64 value as a repeated Sint64.
-func consumeSint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -2534,7 +2534,7 @@ func consumeSint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt64(protowire.DecodeZigZag(v)))
b = b[n:]
@@ -2557,7 +2557,7 @@ func consumeSint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt64(protowire.DecodeZigZag(v)))
out.n = n
@@ -2572,7 +2572,7 @@ var coderSint64SliceValue = valueCoderFuncs{
}
// sizeSint64PackedSliceValue returns the size of wire encoding a []int64 value as a packed repeated Sint64.
-func sizeSint64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSint64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -2587,7 +2587,7 @@ func sizeSint64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshal
}
// appendSint64PackedSliceValue encodes a []int64 value as a packed repeated Sint64.
-func appendSint64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSint64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -2615,13 +2615,13 @@ var coderSint64PackedSliceValue = valueCoderFuncs{
}
// sizeUint64 returns the size of wire encoding a uint64 pointer as a Uint64.
-func sizeUint64(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Uint64()
return f.tagsize + protowire.SizeVarint(v)
}
// appendUint64 wire encodes a uint64 pointer as a Uint64.
-func appendUint64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint64()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, v)
@@ -2629,7 +2629,7 @@ func appendUint64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]b
}
// consumeUint64 wire decodes a uint64 pointer as a Uint64.
-func consumeUint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeUint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -2645,7 +2645,7 @@ func consumeUint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo,
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Uint64() = v
out.n = n
@@ -2661,7 +2661,7 @@ var coderUint64 = pointerCoderFuncs{
// sizeUint64NoZero returns the size of wire encoding a uint64 pointer as a Uint64.
// The zero value is not encoded.
-func sizeUint64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Uint64()
if v == 0 {
return 0
@@ -2671,7 +2671,7 @@ func sizeUint64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendUint64NoZero wire encodes a uint64 pointer as a Uint64.
// The zero value is not encoded.
-func appendUint64NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint64()
if v == 0 {
return b, nil
@@ -2690,14 +2690,14 @@ var coderUint64NoZero = pointerCoderFuncs{
// sizeUint64Ptr returns the size of wire encoding a *uint64 pointer as a Uint64.
// It panics if the pointer is nil.
-func sizeUint64Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.Uint64Ptr()
return f.tagsize + protowire.SizeVarint(v)
}
// appendUint64Ptr wire encodes a *uint64 pointer as a Uint64.
// It panics if the pointer is nil.
-func appendUint64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Uint64Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, v)
@@ -2705,7 +2705,7 @@ func appendUint64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) (
}
// consumeUint64Ptr wire decodes a *uint64 pointer as a Uint64.
-func consumeUint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeUint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
@@ -2721,7 +2721,7 @@ func consumeUint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Uint64Ptr()
if *vp == nil {
@@ -2740,7 +2740,7 @@ var coderUint64Ptr = pointerCoderFuncs{
}
// sizeUint64Slice returns the size of wire encoding a []uint64 pointer as a repeated Uint64.
-func sizeUint64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint64Slice()
for _, v := range s {
size += f.tagsize + protowire.SizeVarint(v)
@@ -2749,7 +2749,7 @@ func sizeUint64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
}
// appendUint64Slice encodes a []uint64 pointer as a repeated Uint64.
-func appendUint64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint64Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -2759,13 +2759,13 @@ func appendUint64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeUint64Slice wire decodes a []uint64 pointer as a repeated Uint64.
-func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Uint64Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -2780,7 +2780,7 @@ func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, v)
b = b[n:]
@@ -2804,7 +2804,7 @@ func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, v)
out.n = n
@@ -2819,7 +2819,7 @@ var coderUint64Slice = pointerCoderFuncs{
}
// sizeUint64PackedSlice returns the size of wire encoding a []uint64 pointer as a packed repeated Uint64.
-func sizeUint64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeUint64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint64Slice()
if len(s) == 0 {
return 0
@@ -2832,7 +2832,7 @@ func sizeUint64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendUint64PackedSlice encodes a []uint64 pointer as a packed repeated Uint64.
-func appendUint64PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendUint64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint64Slice()
if len(s) == 0 {
return b, nil
@@ -2857,19 +2857,19 @@ var coderUint64PackedSlice = pointerCoderFuncs{
}
// sizeUint64Value returns the size of wire encoding a uint64 value as a Uint64.
-func sizeUint64Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeUint64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeVarint(v.Uint())
}
// appendUint64Value encodes a uint64 value as a Uint64.
-func appendUint64Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendUint64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendVarint(b, v.Uint())
return b, nil
}
// consumeUint64Value decodes a uint64 value as a Uint64.
-func consumeUint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeUint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return protoreflect.Value{}, out, errUnknown
}
@@ -2885,7 +2885,7 @@ func consumeUint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfUint64(v), out, nil
@@ -2899,7 +2899,7 @@ var coderUint64Value = valueCoderFuncs{
}
// sizeUint64SliceValue returns the size of wire encoding a []uint64 value as a repeated Uint64.
-func sizeUint64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeUint64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -2909,7 +2909,7 @@ func sizeUint64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOption
}
// appendUint64SliceValue encodes a []uint64 value as a repeated Uint64.
-func appendUint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendUint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -2920,12 +2920,12 @@ func appendUint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeUint64SliceValue wire decodes a []uint64 value as a repeated Uint64.
-func consumeUint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeUint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
var v uint64
@@ -2940,7 +2940,7 @@ func consumeUint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint64(v))
b = b[n:]
@@ -2963,7 +2963,7 @@ func consumeUint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
v, n = protowire.ConsumeVarint(b)
}
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint64(v))
out.n = n
@@ -2978,7 +2978,7 @@ var coderUint64SliceValue = valueCoderFuncs{
}
// sizeUint64PackedSliceValue returns the size of wire encoding a []uint64 value as a packed repeated Uint64.
-func sizeUint64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeUint64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -2993,7 +2993,7 @@ func sizeUint64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshal
}
// appendUint64PackedSliceValue encodes a []uint64 value as a packed repeated Uint64.
-func appendUint64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendUint64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -3021,13 +3021,13 @@ var coderUint64PackedSliceValue = valueCoderFuncs{
}
// sizeSfixed32 returns the size of wire encoding a int32 pointer as a Sfixed32.
-func sizeSfixed32(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed32()
}
// appendSfixed32 wire encodes a int32 pointer as a Sfixed32.
-func appendSfixed32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int32()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed32(b, uint32(v))
@@ -3035,13 +3035,13 @@ func appendSfixed32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([
}
// consumeSfixed32 wire decodes a int32 pointer as a Sfixed32.
-func consumeSfixed32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSfixed32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Int32() = int32(v)
out.n = n
@@ -3057,7 +3057,7 @@ var coderSfixed32 = pointerCoderFuncs{
// sizeSfixed32NoZero returns the size of wire encoding a int32 pointer as a Sfixed32.
// The zero value is not encoded.
-func sizeSfixed32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int32()
if v == 0 {
return 0
@@ -3067,7 +3067,7 @@ func sizeSfixed32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size in
// appendSfixed32NoZero wire encodes a int32 pointer as a Sfixed32.
// The zero value is not encoded.
-func appendSfixed32NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int32()
if v == 0 {
return b, nil
@@ -3086,13 +3086,13 @@ var coderSfixed32NoZero = pointerCoderFuncs{
// sizeSfixed32Ptr returns the size of wire encoding a *int32 pointer as a Sfixed32.
// It panics if the pointer is nil.
-func sizeSfixed32Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed32()
}
// appendSfixed32Ptr wire encodes a *int32 pointer as a Sfixed32.
// It panics if the pointer is nil.
-func appendSfixed32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Int32Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed32(b, uint32(v))
@@ -3100,13 +3100,13 @@ func appendSfixed32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeSfixed32Ptr wire decodes a *int32 pointer as a Sfixed32.
-func consumeSfixed32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSfixed32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Int32Ptr()
if *vp == nil {
@@ -3125,14 +3125,14 @@ var coderSfixed32Ptr = pointerCoderFuncs{
}
// sizeSfixed32Slice returns the size of wire encoding a []int32 pointer as a repeated Sfixed32.
-func sizeSfixed32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int32Slice()
size = len(s) * (f.tagsize + protowire.SizeFixed32())
return size
}
// appendSfixed32Slice encodes a []int32 pointer as a repeated Sfixed32.
-func appendSfixed32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int32Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -3142,18 +3142,18 @@ func appendSfixed32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOption
}
// consumeSfixed32Slice wire decodes a []int32 pointer as a repeated Sfixed32.
-func consumeSfixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSfixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Int32Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, int32(v))
b = b[n:]
@@ -3167,7 +3167,7 @@ func consumeSfixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFiel
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, int32(v))
out.n = n
@@ -3182,7 +3182,7 @@ var coderSfixed32Slice = pointerCoderFuncs{
}
// sizeSfixed32PackedSlice returns the size of wire encoding a []int32 pointer as a packed repeated Sfixed32.
-func sizeSfixed32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int32Slice()
if len(s) == 0 {
return 0
@@ -3192,7 +3192,7 @@ func sizeSfixed32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (si
}
// appendSfixed32PackedSlice encodes a []int32 pointer as a packed repeated Sfixed32.
-func appendSfixed32PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int32Slice()
if len(s) == 0 {
return b, nil
@@ -3214,25 +3214,25 @@ var coderSfixed32PackedSlice = pointerCoderFuncs{
}
// sizeSfixed32Value returns the size of wire encoding a int32 value as a Sfixed32.
-func sizeSfixed32Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeSfixed32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeFixed32()
}
// appendSfixed32Value encodes a int32 value as a Sfixed32.
-func appendSfixed32Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSfixed32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendFixed32(b, uint32(v.Int()))
return b, nil
}
// consumeSfixed32Value decodes a int32 value as a Sfixed32.
-func consumeSfixed32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSfixed32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfInt32(int32(v)), out, nil
@@ -3246,14 +3246,14 @@ var coderSfixed32Value = valueCoderFuncs{
}
// sizeSfixed32SliceValue returns the size of wire encoding a []int32 value as a repeated Sfixed32.
-func sizeSfixed32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSfixed32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
size = list.Len() * (tagsize + protowire.SizeFixed32())
return size
}
// appendSfixed32SliceValue encodes a []int32 value as a repeated Sfixed32.
-func appendSfixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSfixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -3264,17 +3264,17 @@ func appendSfixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64
}
// consumeSfixed32SliceValue wire decodes a []int32 value as a repeated Sfixed32.
-func consumeSfixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSfixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt32(int32(v)))
b = b[n:]
@@ -3287,7 +3287,7 @@ func consumeSfixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.N
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt32(int32(v)))
out.n = n
@@ -3302,7 +3302,7 @@ var coderSfixed32SliceValue = valueCoderFuncs{
}
// sizeSfixed32PackedSliceValue returns the size of wire encoding a []int32 value as a packed repeated Sfixed32.
-func sizeSfixed32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSfixed32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -3313,7 +3313,7 @@ func sizeSfixed32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marsh
}
// appendSfixed32PackedSliceValue encodes a []int32 value as a packed repeated Sfixed32.
-func appendSfixed32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSfixed32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -3337,13 +3337,13 @@ var coderSfixed32PackedSliceValue = valueCoderFuncs{
}
// sizeFixed32 returns the size of wire encoding a uint32 pointer as a Fixed32.
-func sizeFixed32(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed32()
}
// appendFixed32 wire encodes a uint32 pointer as a Fixed32.
-func appendFixed32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint32()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed32(b, v)
@@ -3351,13 +3351,13 @@ func appendFixed32(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]
}
// consumeFixed32 wire decodes a uint32 pointer as a Fixed32.
-func consumeFixed32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFixed32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Uint32() = v
out.n = n
@@ -3373,7 +3373,7 @@ var coderFixed32 = pointerCoderFuncs{
// sizeFixed32NoZero returns the size of wire encoding a uint32 pointer as a Fixed32.
// The zero value is not encoded.
-func sizeFixed32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Uint32()
if v == 0 {
return 0
@@ -3383,7 +3383,7 @@ func sizeFixed32NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int
// appendFixed32NoZero wire encodes a uint32 pointer as a Fixed32.
// The zero value is not encoded.
-func appendFixed32NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint32()
if v == 0 {
return b, nil
@@ -3402,13 +3402,13 @@ var coderFixed32NoZero = pointerCoderFuncs{
// sizeFixed32Ptr returns the size of wire encoding a *uint32 pointer as a Fixed32.
// It panics if the pointer is nil.
-func sizeFixed32Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed32()
}
// appendFixed32Ptr wire encodes a *uint32 pointer as a Fixed32.
// It panics if the pointer is nil.
-func appendFixed32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Uint32Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed32(b, v)
@@ -3416,13 +3416,13 @@ func appendFixed32Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeFixed32Ptr wire decodes a *uint32 pointer as a Fixed32.
-func consumeFixed32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFixed32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Uint32Ptr()
if *vp == nil {
@@ -3441,14 +3441,14 @@ var coderFixed32Ptr = pointerCoderFuncs{
}
// sizeFixed32Slice returns the size of wire encoding a []uint32 pointer as a repeated Fixed32.
-func sizeFixed32Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint32Slice()
size = len(s) * (f.tagsize + protowire.SizeFixed32())
return size
}
// appendFixed32Slice encodes a []uint32 pointer as a repeated Fixed32.
-func appendFixed32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint32Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -3458,18 +3458,18 @@ func appendFixed32Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions
}
// consumeFixed32Slice wire decodes a []uint32 pointer as a repeated Fixed32.
-func consumeFixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Uint32Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, v)
b = b[n:]
@@ -3483,7 +3483,7 @@ func consumeFixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderField
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, v)
out.n = n
@@ -3498,7 +3498,7 @@ var coderFixed32Slice = pointerCoderFuncs{
}
// sizeFixed32PackedSlice returns the size of wire encoding a []uint32 pointer as a packed repeated Fixed32.
-func sizeFixed32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint32Slice()
if len(s) == 0 {
return 0
@@ -3508,7 +3508,7 @@ func sizeFixed32PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (siz
}
// appendFixed32PackedSlice encodes a []uint32 pointer as a packed repeated Fixed32.
-func appendFixed32PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint32Slice()
if len(s) == 0 {
return b, nil
@@ -3530,25 +3530,25 @@ var coderFixed32PackedSlice = pointerCoderFuncs{
}
// sizeFixed32Value returns the size of wire encoding a uint32 value as a Fixed32.
-func sizeFixed32Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeFixed32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeFixed32()
}
// appendFixed32Value encodes a uint32 value as a Fixed32.
-func appendFixed32Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFixed32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendFixed32(b, uint32(v.Uint()))
return b, nil
}
// consumeFixed32Value decodes a uint32 value as a Fixed32.
-func consumeFixed32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeFixed32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfUint32(uint32(v)), out, nil
@@ -3562,14 +3562,14 @@ var coderFixed32Value = valueCoderFuncs{
}
// sizeFixed32SliceValue returns the size of wire encoding a []uint32 value as a repeated Fixed32.
-func sizeFixed32SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeFixed32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
size = list.Len() * (tagsize + protowire.SizeFixed32())
return size
}
// appendFixed32SliceValue encodes a []uint32 value as a repeated Fixed32.
-func appendFixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -3580,17 +3580,17 @@ func appendFixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeFixed32SliceValue wire decodes a []uint32 value as a repeated Fixed32.
-func consumeFixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeFixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint32(uint32(v)))
b = b[n:]
@@ -3603,7 +3603,7 @@ func consumeFixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Nu
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint32(uint32(v)))
out.n = n
@@ -3618,7 +3618,7 @@ var coderFixed32SliceValue = valueCoderFuncs{
}
// sizeFixed32PackedSliceValue returns the size of wire encoding a []uint32 value as a packed repeated Fixed32.
-func sizeFixed32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeFixed32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -3629,7 +3629,7 @@ func sizeFixed32PackedSliceValue(listv protoreflect.Value, tagsize int, _ marsha
}
// appendFixed32PackedSliceValue encodes a []uint32 value as a packed repeated Fixed32.
-func appendFixed32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFixed32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -3653,13 +3653,13 @@ var coderFixed32PackedSliceValue = valueCoderFuncs{
}
// sizeFloat returns the size of wire encoding a float32 pointer as a Float.
-func sizeFloat(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFloat(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed32()
}
// appendFloat wire encodes a float32 pointer as a Float.
-func appendFloat(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFloat(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Float32()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed32(b, math.Float32bits(v))
@@ -3667,13 +3667,13 @@ func appendFloat(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]by
}
// consumeFloat wire decodes a float32 pointer as a Float.
-func consumeFloat(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFloat(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Float32() = math.Float32frombits(v)
out.n = n
@@ -3689,7 +3689,7 @@ var coderFloat = pointerCoderFuncs{
// sizeFloatNoZero returns the size of wire encoding a float32 pointer as a Float.
// The zero value is not encoded.
-func sizeFloatNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFloatNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Float32()
if v == 0 && !math.Signbit(float64(v)) {
return 0
@@ -3699,7 +3699,7 @@ func sizeFloatNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendFloatNoZero wire encodes a float32 pointer as a Float.
// The zero value is not encoded.
-func appendFloatNoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFloatNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Float32()
if v == 0 && !math.Signbit(float64(v)) {
return b, nil
@@ -3718,13 +3718,13 @@ var coderFloatNoZero = pointerCoderFuncs{
// sizeFloatPtr returns the size of wire encoding a *float32 pointer as a Float.
// It panics if the pointer is nil.
-func sizeFloatPtr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFloatPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed32()
}
// appendFloatPtr wire encodes a *float32 pointer as a Float.
// It panics if the pointer is nil.
-func appendFloatPtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFloatPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Float32Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed32(b, math.Float32bits(v))
@@ -3732,13 +3732,13 @@ func appendFloatPtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([
}
// consumeFloatPtr wire decodes a *float32 pointer as a Float.
-func consumeFloatPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFloatPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Float32Ptr()
if *vp == nil {
@@ -3757,14 +3757,14 @@ var coderFloatPtr = pointerCoderFuncs{
}
// sizeFloatSlice returns the size of wire encoding a []float32 pointer as a repeated Float.
-func sizeFloatSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFloatSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Float32Slice()
size = len(s) * (f.tagsize + protowire.SizeFixed32())
return size
}
// appendFloatSlice encodes a []float32 pointer as a repeated Float.
-func appendFloatSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFloatSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Float32Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -3774,18 +3774,18 @@ func appendFloatSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeFloatSlice wire decodes a []float32 pointer as a repeated Float.
-func consumeFloatSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFloatSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Float32Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, math.Float32frombits(v))
b = b[n:]
@@ -3799,7 +3799,7 @@ func consumeFloatSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldIn
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, math.Float32frombits(v))
out.n = n
@@ -3814,7 +3814,7 @@ var coderFloatSlice = pointerCoderFuncs{
}
// sizeFloatPackedSlice returns the size of wire encoding a []float32 pointer as a packed repeated Float.
-func sizeFloatPackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFloatPackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Float32Slice()
if len(s) == 0 {
return 0
@@ -3824,7 +3824,7 @@ func sizeFloatPackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendFloatPackedSlice encodes a []float32 pointer as a packed repeated Float.
-func appendFloatPackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFloatPackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Float32Slice()
if len(s) == 0 {
return b, nil
@@ -3846,25 +3846,25 @@ var coderFloatPackedSlice = pointerCoderFuncs{
}
// sizeFloatValue returns the size of wire encoding a float32 value as a Float.
-func sizeFloatValue(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeFloatValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeFixed32()
}
// appendFloatValue encodes a float32 value as a Float.
-func appendFloatValue(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFloatValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendFixed32(b, math.Float32bits(float32(v.Float())))
return b, nil
}
// consumeFloatValue decodes a float32 value as a Float.
-func consumeFloatValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeFloatValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.Fixed32Type {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v))), out, nil
@@ -3878,14 +3878,14 @@ var coderFloatValue = valueCoderFuncs{
}
// sizeFloatSliceValue returns the size of wire encoding a []float32 value as a repeated Float.
-func sizeFloatSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeFloatSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
size = list.Len() * (tagsize + protowire.SizeFixed32())
return size
}
// appendFloatSliceValue encodes a []float32 value as a repeated Float.
-func appendFloatSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFloatSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -3896,17 +3896,17 @@ func appendFloatSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _
}
// consumeFloatSliceValue wire decodes a []float32 value as a repeated Float.
-func consumeFloatSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeFloatSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v))))
b = b[n:]
@@ -3919,7 +3919,7 @@ func consumeFloatSliceValue(b []byte, listv protoreflect.Value, _ protowire.Numb
}
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v))))
out.n = n
@@ -3934,7 +3934,7 @@ var coderFloatSliceValue = valueCoderFuncs{
}
// sizeFloatPackedSliceValue returns the size of wire encoding a []float32 value as a packed repeated Float.
-func sizeFloatPackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeFloatPackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -3945,7 +3945,7 @@ func sizeFloatPackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalO
}
// appendFloatPackedSliceValue encodes a []float32 value as a packed repeated Float.
-func appendFloatPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFloatPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -3969,13 +3969,13 @@ var coderFloatPackedSliceValue = valueCoderFuncs{
}
// sizeSfixed64 returns the size of wire encoding a int64 pointer as a Sfixed64.
-func sizeSfixed64(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed64()
}
// appendSfixed64 wire encodes a int64 pointer as a Sfixed64.
-func appendSfixed64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int64()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed64(b, uint64(v))
@@ -3983,13 +3983,13 @@ func appendSfixed64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([
}
// consumeSfixed64 wire decodes a int64 pointer as a Sfixed64.
-func consumeSfixed64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSfixed64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Int64() = int64(v)
out.n = n
@@ -4005,7 +4005,7 @@ var coderSfixed64 = pointerCoderFuncs{
// sizeSfixed64NoZero returns the size of wire encoding a int64 pointer as a Sfixed64.
// The zero value is not encoded.
-func sizeSfixed64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Int64()
if v == 0 {
return 0
@@ -4015,7 +4015,7 @@ func sizeSfixed64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size in
// appendSfixed64NoZero wire encodes a int64 pointer as a Sfixed64.
// The zero value is not encoded.
-func appendSfixed64NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Int64()
if v == 0 {
return b, nil
@@ -4034,13 +4034,13 @@ var coderSfixed64NoZero = pointerCoderFuncs{
// sizeSfixed64Ptr returns the size of wire encoding a *int64 pointer as a Sfixed64.
// It panics if the pointer is nil.
-func sizeSfixed64Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed64()
}
// appendSfixed64Ptr wire encodes a *int64 pointer as a Sfixed64.
// It panics if the pointer is nil.
-func appendSfixed64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Int64Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed64(b, uint64(v))
@@ -4048,13 +4048,13 @@ func appendSfixed64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeSfixed64Ptr wire decodes a *int64 pointer as a Sfixed64.
-func consumeSfixed64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSfixed64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Int64Ptr()
if *vp == nil {
@@ -4073,14 +4073,14 @@ var coderSfixed64Ptr = pointerCoderFuncs{
}
// sizeSfixed64Slice returns the size of wire encoding a []int64 pointer as a repeated Sfixed64.
-func sizeSfixed64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int64Slice()
size = len(s) * (f.tagsize + protowire.SizeFixed64())
return size
}
// appendSfixed64Slice encodes a []int64 pointer as a repeated Sfixed64.
-func appendSfixed64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int64Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -4090,18 +4090,18 @@ func appendSfixed64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOption
}
// consumeSfixed64Slice wire decodes a []int64 pointer as a repeated Sfixed64.
-func consumeSfixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeSfixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Int64Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, int64(v))
b = b[n:]
@@ -4115,7 +4115,7 @@ func consumeSfixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFiel
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, int64(v))
out.n = n
@@ -4130,7 +4130,7 @@ var coderSfixed64Slice = pointerCoderFuncs{
}
// sizeSfixed64PackedSlice returns the size of wire encoding a []int64 pointer as a packed repeated Sfixed64.
-func sizeSfixed64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeSfixed64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Int64Slice()
if len(s) == 0 {
return 0
@@ -4140,7 +4140,7 @@ func sizeSfixed64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (si
}
// appendSfixed64PackedSlice encodes a []int64 pointer as a packed repeated Sfixed64.
-func appendSfixed64PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendSfixed64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Int64Slice()
if len(s) == 0 {
return b, nil
@@ -4162,25 +4162,25 @@ var coderSfixed64PackedSlice = pointerCoderFuncs{
}
// sizeSfixed64Value returns the size of wire encoding a int64 value as a Sfixed64.
-func sizeSfixed64Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeSfixed64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeFixed64()
}
// appendSfixed64Value encodes a int64 value as a Sfixed64.
-func appendSfixed64Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSfixed64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendFixed64(b, uint64(v.Int()))
return b, nil
}
// consumeSfixed64Value decodes a int64 value as a Sfixed64.
-func consumeSfixed64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSfixed64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfInt64(int64(v)), out, nil
@@ -4194,14 +4194,14 @@ var coderSfixed64Value = valueCoderFuncs{
}
// sizeSfixed64SliceValue returns the size of wire encoding a []int64 value as a repeated Sfixed64.
-func sizeSfixed64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSfixed64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
size = list.Len() * (tagsize + protowire.SizeFixed64())
return size
}
// appendSfixed64SliceValue encodes a []int64 value as a repeated Sfixed64.
-func appendSfixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSfixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -4212,17 +4212,17 @@ func appendSfixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64
}
// consumeSfixed64SliceValue wire decodes a []int64 value as a repeated Sfixed64.
-func consumeSfixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeSfixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt64(int64(v)))
b = b[n:]
@@ -4235,7 +4235,7 @@ func consumeSfixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.N
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfInt64(int64(v)))
out.n = n
@@ -4250,7 +4250,7 @@ var coderSfixed64SliceValue = valueCoderFuncs{
}
// sizeSfixed64PackedSliceValue returns the size of wire encoding a []int64 value as a packed repeated Sfixed64.
-func sizeSfixed64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeSfixed64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -4261,7 +4261,7 @@ func sizeSfixed64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marsh
}
// appendSfixed64PackedSliceValue encodes a []int64 value as a packed repeated Sfixed64.
-func appendSfixed64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendSfixed64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -4285,13 +4285,13 @@ var coderSfixed64PackedSliceValue = valueCoderFuncs{
}
// sizeFixed64 returns the size of wire encoding a uint64 pointer as a Fixed64.
-func sizeFixed64(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed64()
}
// appendFixed64 wire encodes a uint64 pointer as a Fixed64.
-func appendFixed64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint64()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed64(b, v)
@@ -4299,13 +4299,13 @@ func appendFixed64(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]
}
// consumeFixed64 wire decodes a uint64 pointer as a Fixed64.
-func consumeFixed64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFixed64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Uint64() = v
out.n = n
@@ -4321,7 +4321,7 @@ var coderFixed64 = pointerCoderFuncs{
// sizeFixed64NoZero returns the size of wire encoding a uint64 pointer as a Fixed64.
// The zero value is not encoded.
-func sizeFixed64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Uint64()
if v == 0 {
return 0
@@ -4331,7 +4331,7 @@ func sizeFixed64NoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int
// appendFixed64NoZero wire encodes a uint64 pointer as a Fixed64.
// The zero value is not encoded.
-func appendFixed64NoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Uint64()
if v == 0 {
return b, nil
@@ -4350,13 +4350,13 @@ var coderFixed64NoZero = pointerCoderFuncs{
// sizeFixed64Ptr returns the size of wire encoding a *uint64 pointer as a Fixed64.
// It panics if the pointer is nil.
-func sizeFixed64Ptr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed64()
}
// appendFixed64Ptr wire encodes a *uint64 pointer as a Fixed64.
// It panics if the pointer is nil.
-func appendFixed64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Uint64Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed64(b, v)
@@ -4364,13 +4364,13 @@ func appendFixed64Ptr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeFixed64Ptr wire decodes a *uint64 pointer as a Fixed64.
-func consumeFixed64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFixed64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Uint64Ptr()
if *vp == nil {
@@ -4389,14 +4389,14 @@ var coderFixed64Ptr = pointerCoderFuncs{
}
// sizeFixed64Slice returns the size of wire encoding a []uint64 pointer as a repeated Fixed64.
-func sizeFixed64Slice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint64Slice()
size = len(s) * (f.tagsize + protowire.SizeFixed64())
return size
}
// appendFixed64Slice encodes a []uint64 pointer as a repeated Fixed64.
-func appendFixed64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint64Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -4406,18 +4406,18 @@ func appendFixed64Slice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions
}
// consumeFixed64Slice wire decodes a []uint64 pointer as a repeated Fixed64.
-func consumeFixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeFixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Uint64Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, v)
b = b[n:]
@@ -4431,7 +4431,7 @@ func consumeFixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderField
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, v)
out.n = n
@@ -4446,7 +4446,7 @@ var coderFixed64Slice = pointerCoderFuncs{
}
// sizeFixed64PackedSlice returns the size of wire encoding a []uint64 pointer as a packed repeated Fixed64.
-func sizeFixed64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeFixed64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Uint64Slice()
if len(s) == 0 {
return 0
@@ -4456,7 +4456,7 @@ func sizeFixed64PackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (siz
}
// appendFixed64PackedSlice encodes a []uint64 pointer as a packed repeated Fixed64.
-func appendFixed64PackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendFixed64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Uint64Slice()
if len(s) == 0 {
return b, nil
@@ -4478,25 +4478,25 @@ var coderFixed64PackedSlice = pointerCoderFuncs{
}
// sizeFixed64Value returns the size of wire encoding a uint64 value as a Fixed64.
-func sizeFixed64Value(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeFixed64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeFixed64()
}
// appendFixed64Value encodes a uint64 value as a Fixed64.
-func appendFixed64Value(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFixed64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendFixed64(b, v.Uint())
return b, nil
}
// consumeFixed64Value decodes a uint64 value as a Fixed64.
-func consumeFixed64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeFixed64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfUint64(v), out, nil
@@ -4510,14 +4510,14 @@ var coderFixed64Value = valueCoderFuncs{
}
// sizeFixed64SliceValue returns the size of wire encoding a []uint64 value as a repeated Fixed64.
-func sizeFixed64SliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeFixed64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
size = list.Len() * (tagsize + protowire.SizeFixed64())
return size
}
// appendFixed64SliceValue encodes a []uint64 value as a repeated Fixed64.
-func appendFixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -4528,17 +4528,17 @@ func appendFixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeFixed64SliceValue wire decodes a []uint64 value as a repeated Fixed64.
-func consumeFixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeFixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint64(v))
b = b[n:]
@@ -4551,7 +4551,7 @@ func consumeFixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Nu
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfUint64(v))
out.n = n
@@ -4566,7 +4566,7 @@ var coderFixed64SliceValue = valueCoderFuncs{
}
// sizeFixed64PackedSliceValue returns the size of wire encoding a []uint64 value as a packed repeated Fixed64.
-func sizeFixed64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeFixed64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -4577,7 +4577,7 @@ func sizeFixed64PackedSliceValue(listv protoreflect.Value, tagsize int, _ marsha
}
// appendFixed64PackedSliceValue encodes a []uint64 value as a packed repeated Fixed64.
-func appendFixed64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendFixed64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -4601,13 +4601,13 @@ var coderFixed64PackedSliceValue = valueCoderFuncs{
}
// sizeDouble returns the size of wire encoding a float64 pointer as a Double.
-func sizeDouble(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeDouble(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed64()
}
// appendDouble wire encodes a float64 pointer as a Double.
-func appendDouble(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendDouble(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Float64()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed64(b, math.Float64bits(v))
@@ -4615,13 +4615,13 @@ func appendDouble(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]b
}
// consumeDouble wire decodes a float64 pointer as a Double.
-func consumeDouble(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeDouble(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Float64() = math.Float64frombits(v)
out.n = n
@@ -4637,7 +4637,7 @@ var coderDouble = pointerCoderFuncs{
// sizeDoubleNoZero returns the size of wire encoding a float64 pointer as a Double.
// The zero value is not encoded.
-func sizeDoubleNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeDoubleNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Float64()
if v == 0 && !math.Signbit(float64(v)) {
return 0
@@ -4647,7 +4647,7 @@ func sizeDoubleNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendDoubleNoZero wire encodes a float64 pointer as a Double.
// The zero value is not encoded.
-func appendDoubleNoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendDoubleNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Float64()
if v == 0 && !math.Signbit(float64(v)) {
return b, nil
@@ -4666,13 +4666,13 @@ var coderDoubleNoZero = pointerCoderFuncs{
// sizeDoublePtr returns the size of wire encoding a *float64 pointer as a Double.
// It panics if the pointer is nil.
-func sizeDoublePtr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeDoublePtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return f.tagsize + protowire.SizeFixed64()
}
// appendDoublePtr wire encodes a *float64 pointer as a Double.
// It panics if the pointer is nil.
-func appendDoublePtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendDoublePtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.Float64Ptr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendFixed64(b, math.Float64bits(v))
@@ -4680,13 +4680,13 @@ func appendDoublePtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) (
}
// consumeDoublePtr wire decodes a *float64 pointer as a Double.
-func consumeDoublePtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeDoublePtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.Float64Ptr()
if *vp == nil {
@@ -4705,14 +4705,14 @@ var coderDoublePtr = pointerCoderFuncs{
}
// sizeDoubleSlice returns the size of wire encoding a []float64 pointer as a repeated Double.
-func sizeDoubleSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeDoubleSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Float64Slice()
size = len(s) * (f.tagsize + protowire.SizeFixed64())
return size
}
// appendDoubleSlice encodes a []float64 pointer as a repeated Double.
-func appendDoubleSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendDoubleSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Float64Slice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -4722,18 +4722,18 @@ func appendDoubleSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeDoubleSlice wire decodes a []float64 pointer as a repeated Double.
-func consumeDoubleSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeDoubleSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.Float64Slice()
if wtyp == protowire.BytesType {
s := *sp
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
s = append(s, math.Float64frombits(v))
b = b[n:]
@@ -4747,7 +4747,7 @@ func consumeDoubleSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldI
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, math.Float64frombits(v))
out.n = n
@@ -4762,7 +4762,7 @@ var coderDoubleSlice = pointerCoderFuncs{
}
// sizeDoublePackedSlice returns the size of wire encoding a []float64 pointer as a packed repeated Double.
-func sizeDoublePackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeDoublePackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.Float64Slice()
if len(s) == 0 {
return 0
@@ -4772,7 +4772,7 @@ func sizeDoublePackedSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size
}
// appendDoublePackedSlice encodes a []float64 pointer as a packed repeated Double.
-func appendDoublePackedSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendDoublePackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.Float64Slice()
if len(s) == 0 {
return b, nil
@@ -4794,25 +4794,25 @@ var coderDoublePackedSlice = pointerCoderFuncs{
}
// sizeDoubleValue returns the size of wire encoding a float64 value as a Double.
-func sizeDoubleValue(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeDoubleValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeFixed64()
}
// appendDoubleValue encodes a float64 value as a Double.
-func appendDoubleValue(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendDoubleValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendFixed64(b, math.Float64bits(v.Float()))
return b, nil
}
// consumeDoubleValue decodes a float64 value as a Double.
-func consumeDoubleValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeDoubleValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.Fixed64Type {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfFloat64(math.Float64frombits(v)), out, nil
@@ -4826,14 +4826,14 @@ var coderDoubleValue = valueCoderFuncs{
}
// sizeDoubleSliceValue returns the size of wire encoding a []float64 value as a repeated Double.
-func sizeDoubleSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeDoubleSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
size = list.Len() * (tagsize + protowire.SizeFixed64())
return size
}
// appendDoubleSliceValue encodes a []float64 value as a repeated Double.
-func appendDoubleSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendDoubleSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -4844,17 +4844,17 @@ func appendDoubleSliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeDoubleSliceValue wire decodes a []float64 value as a repeated Double.
-func consumeDoubleSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeDoubleSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
for len(b) > 0 {
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfFloat64(math.Float64frombits(v)))
b = b[n:]
@@ -4867,7 +4867,7 @@ func consumeDoubleSliceValue(b []byte, listv protoreflect.Value, _ protowire.Num
}
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfFloat64(math.Float64frombits(v)))
out.n = n
@@ -4882,7 +4882,7 @@ var coderDoubleSliceValue = valueCoderFuncs{
}
// sizeDoublePackedSliceValue returns the size of wire encoding a []float64 value as a packed repeated Double.
-func sizeDoublePackedSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeDoublePackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -4893,7 +4893,7 @@ func sizeDoublePackedSliceValue(listv protoreflect.Value, tagsize int, _ marshal
}
// appendDoublePackedSliceValue encodes a []float64 value as a packed repeated Double.
-func appendDoublePackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendDoublePackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
llen := list.Len()
if llen == 0 {
@@ -4917,13 +4917,13 @@ var coderDoublePackedSliceValue = valueCoderFuncs{
}
// sizeString returns the size of wire encoding a string pointer as a String.
-func sizeString(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeString(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.String()
return f.tagsize + protowire.SizeBytes(len(v))
}
// appendString wire encodes a string pointer as a String.
-func appendString(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendString(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.String()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendString(b, v)
@@ -4931,15 +4931,15 @@ func appendString(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]b
}
// consumeString wire decodes a string pointer as a String.
-func consumeString(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeString(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
- *p.String() = v
+ *p.String() = string(v)
out.n = n
return out, nil
}
@@ -4952,7 +4952,7 @@ var coderString = pointerCoderFuncs{
}
// appendStringValidateUTF8 wire encodes a string pointer as a String.
-func appendStringValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendStringValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.String()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendString(b, v)
@@ -4963,18 +4963,18 @@ func appendStringValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalO
}
// consumeStringValidateUTF8 wire decodes a string pointer as a String.
-func consumeStringValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeStringValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
- if !utf8.ValidString(v) {
+ if !utf8.Valid(v) {
return out, errInvalidUTF8{}
}
- *p.String() = v
+ *p.String() = string(v)
out.n = n
return out, nil
}
@@ -4988,7 +4988,7 @@ var coderStringValidateUTF8 = pointerCoderFuncs{
// sizeStringNoZero returns the size of wire encoding a string pointer as a String.
// The zero value is not encoded.
-func sizeStringNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeStringNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.String()
if len(v) == 0 {
return 0
@@ -4998,7 +4998,7 @@ func sizeStringNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendStringNoZero wire encodes a string pointer as a String.
// The zero value is not encoded.
-func appendStringNoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendStringNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.String()
if len(v) == 0 {
return b, nil
@@ -5017,7 +5017,7 @@ var coderStringNoZero = pointerCoderFuncs{
// appendStringNoZeroValidateUTF8 wire encodes a string pointer as a String.
// The zero value is not encoded.
-func appendStringNoZeroValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendStringNoZeroValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.String()
if len(v) == 0 {
return b, nil
@@ -5039,14 +5039,14 @@ var coderStringNoZeroValidateUTF8 = pointerCoderFuncs{
// sizeStringPtr returns the size of wire encoding a *string pointer as a String.
// It panics if the pointer is nil.
-func sizeStringPtr(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeStringPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := **p.StringPtr()
return f.tagsize + protowire.SizeBytes(len(v))
}
// appendStringPtr wire encodes a *string pointer as a String.
// It panics if the pointer is nil.
-func appendStringPtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendStringPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.StringPtr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendString(b, v)
@@ -5054,19 +5054,19 @@ func appendStringPtr(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) (
}
// consumeStringPtr wire decodes a *string pointer as a String.
-func consumeStringPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeStringPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
vp := p.StringPtr()
if *vp == nil {
*vp = new(string)
}
- **vp = v
+ **vp = string(v)
out.n = n
return out, nil
}
@@ -5080,7 +5080,7 @@ var coderStringPtr = pointerCoderFuncs{
// appendStringPtrValidateUTF8 wire encodes a *string pointer as a String.
// It panics if the pointer is nil.
-func appendStringPtrValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendStringPtrValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := **p.StringPtr()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendString(b, v)
@@ -5091,22 +5091,22 @@ func appendStringPtrValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marsh
}
// consumeStringPtrValidateUTF8 wire decodes a *string pointer as a String.
-func consumeStringPtrValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeStringPtrValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
- if !utf8.ValidString(v) {
+ if !utf8.Valid(v) {
return out, errInvalidUTF8{}
}
vp := p.StringPtr()
if *vp == nil {
*vp = new(string)
}
- **vp = v
+ **vp = string(v)
out.n = n
return out, nil
}
@@ -5119,7 +5119,7 @@ var coderStringPtrValidateUTF8 = pointerCoderFuncs{
}
// sizeStringSlice returns the size of wire encoding a []string pointer as a repeated String.
-func sizeStringSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeStringSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.StringSlice()
for _, v := range s {
size += f.tagsize + protowire.SizeBytes(len(v))
@@ -5128,7 +5128,7 @@ func sizeStringSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
}
// appendStringSlice encodes a []string pointer as a repeated String.
-func appendStringSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendStringSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.StringSlice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -5138,16 +5138,16 @@ func appendStringSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeStringSlice wire decodes a []string pointer as a repeated String.
-func consumeStringSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeStringSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.StringSlice()
if wtyp != protowire.BytesType {
return out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
- *sp = append(*sp, v)
+ *sp = append(*sp, string(v))
out.n = n
return out, nil
}
@@ -5160,7 +5160,7 @@ var coderStringSlice = pointerCoderFuncs{
}
// appendStringSliceValidateUTF8 encodes a []string pointer as a repeated String.
-func appendStringSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendStringSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.StringSlice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -5173,19 +5173,19 @@ func appendStringSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ mar
}
// consumeStringSliceValidateUTF8 wire decodes a []string pointer as a repeated String.
-func consumeStringSliceValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
- sp := p.StringSlice()
+func consumeStringSliceValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
- if !utf8.ValidString(v) {
+ if !utf8.Valid(v) {
return out, errInvalidUTF8{}
}
- *sp = append(*sp, v)
+ sp := p.StringSlice()
+ *sp = append(*sp, string(v))
out.n = n
return out, nil
}
@@ -5198,25 +5198,25 @@ var coderStringSliceValidateUTF8 = pointerCoderFuncs{
}
// sizeStringValue returns the size of wire encoding a string value as a String.
-func sizeStringValue(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeStringValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeBytes(len(v.String()))
}
// appendStringValue encodes a string value as a String.
-func appendStringValue(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendStringValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendString(b, v.String())
return b, nil
}
// consumeStringValue decodes a string value as a String.
-func consumeStringValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeStringValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return protoreflect.Value{}, out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfString(string(v)), out, nil
@@ -5230,7 +5230,7 @@ var coderStringValue = valueCoderFuncs{
}
// appendStringValueValidateUTF8 encodes a string value as a String.
-func appendStringValueValidateUTF8(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendStringValueValidateUTF8(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendString(b, v.String())
if !utf8.ValidString(v.String()) {
@@ -5240,15 +5240,15 @@ func appendStringValueValidateUTF8(b []byte, v protoreflect.Value, wiretag uint6
}
// consumeStringValueValidateUTF8 decodes a string value as a String.
-func consumeStringValueValidateUTF8(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeStringValueValidateUTF8(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return protoreflect.Value{}, out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
- if !utf8.ValidString(v) {
+ if !utf8.Valid(v) {
return protoreflect.Value{}, out, errInvalidUTF8{}
}
out.n = n
@@ -5263,7 +5263,7 @@ var coderStringValueValidateUTF8 = valueCoderFuncs{
}
// sizeStringSliceValue returns the size of wire encoding a []string value as a repeated String.
-func sizeStringSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeStringSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -5273,7 +5273,7 @@ func sizeStringSliceValue(listv protoreflect.Value, tagsize int, _ marshalOption
}
// appendStringSliceValue encodes a []string value as a repeated String.
-func appendStringSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendStringSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -5284,14 +5284,14 @@ func appendStringSliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
}
// consumeStringSliceValue wire decodes a []string value as a repeated String.
-func consumeStringSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeStringSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp != protowire.BytesType {
return protoreflect.Value{}, out, errUnknown
}
- v, n := protowire.ConsumeString(b)
+ v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfString(string(v)))
out.n = n
@@ -5306,13 +5306,13 @@ var coderStringSliceValue = valueCoderFuncs{
}
// sizeBytes returns the size of wire encoding a []byte pointer as a Bytes.
-func sizeBytes(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBytes(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Bytes()
return f.tagsize + protowire.SizeBytes(len(v))
}
// appendBytes wire encodes a []byte pointer as a Bytes.
-func appendBytes(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBytes(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Bytes()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendBytes(b, v)
@@ -5320,13 +5320,13 @@ func appendBytes(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]by
}
// consumeBytes wire decodes a []byte pointer as a Bytes.
-func consumeBytes(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBytes(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Bytes() = append(emptyBuf[:], v...)
out.n = n
@@ -5341,7 +5341,7 @@ var coderBytes = pointerCoderFuncs{
}
// appendBytesValidateUTF8 wire encodes a []byte pointer as a Bytes.
-func appendBytesValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBytesValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Bytes()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendBytes(b, v)
@@ -5352,13 +5352,13 @@ func appendBytesValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOp
}
// consumeBytesValidateUTF8 wire decodes a []byte pointer as a Bytes.
-func consumeBytesValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBytesValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
if !utf8.Valid(v) {
return out, errInvalidUTF8{}
@@ -5377,7 +5377,7 @@ var coderBytesValidateUTF8 = pointerCoderFuncs{
// sizeBytesNoZero returns the size of wire encoding a []byte pointer as a Bytes.
// The zero value is not encoded.
-func sizeBytesNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBytesNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
v := *p.Bytes()
if len(v) == 0 {
return 0
@@ -5387,7 +5387,7 @@ func sizeBytesNoZero(p pointer, f *coderFieldInfo, _ marshalOptions) (size int)
// appendBytesNoZero wire encodes a []byte pointer as a Bytes.
// The zero value is not encoded.
-func appendBytesNoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBytesNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Bytes()
if len(v) == 0 {
return b, nil
@@ -5399,13 +5399,13 @@ func appendBytesNoZero(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
// consumeBytesNoZero wire decodes a []byte pointer as a Bytes.
// The zero value is not decoded.
-func consumeBytesNoZero(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBytesNoZero(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*p.Bytes() = append(([]byte)(nil), v...)
out.n = n
@@ -5421,7 +5421,7 @@ var coderBytesNoZero = pointerCoderFuncs{
// appendBytesNoZeroValidateUTF8 wire encodes a []byte pointer as a Bytes.
// The zero value is not encoded.
-func appendBytesNoZeroValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBytesNoZeroValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := *p.Bytes()
if len(v) == 0 {
return b, nil
@@ -5435,13 +5435,13 @@ func appendBytesNoZeroValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ mar
}
// consumeBytesNoZeroValidateUTF8 wire decodes a []byte pointer as a Bytes.
-func consumeBytesNoZeroValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBytesNoZeroValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
if !utf8.Valid(v) {
return out, errInvalidUTF8{}
@@ -5459,7 +5459,7 @@ var coderBytesNoZeroValidateUTF8 = pointerCoderFuncs{
}
// sizeBytesSlice returns the size of wire encoding a [][]byte pointer as a repeated Bytes.
-func sizeBytesSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
+func sizeBytesSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := *p.BytesSlice()
for _, v := range s {
size += f.tagsize + protowire.SizeBytes(len(v))
@@ -5468,7 +5468,7 @@ func sizeBytesSlice(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
}
// appendBytesSlice encodes a [][]byte pointer as a repeated Bytes.
-func appendBytesSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBytesSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.BytesSlice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -5478,14 +5478,14 @@ func appendBytesSlice(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions)
}
// consumeBytesSlice wire decodes a [][]byte pointer as a repeated Bytes.
-func consumeBytesSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
+func consumeBytesSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
sp := p.BytesSlice()
if wtyp != protowire.BytesType {
return out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
*sp = append(*sp, append(emptyBuf[:], v...))
out.n = n
@@ -5500,7 +5500,7 @@ var coderBytesSlice = pointerCoderFuncs{
}
// appendBytesSliceValidateUTF8 encodes a [][]byte pointer as a repeated Bytes.
-func appendBytesSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ marshalOptions) ([]byte, error) {
+func appendBytesSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := *p.BytesSlice()
for _, v := range s {
b = protowire.AppendVarint(b, f.wiretag)
@@ -5513,18 +5513,18 @@ func appendBytesSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, _ mars
}
// consumeBytesSliceValidateUTF8 wire decodes a [][]byte pointer as a repeated Bytes.
-func consumeBytesSliceValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
- sp := p.BytesSlice()
+func consumeBytesSliceValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return out, protowire.ParseError(n)
+ return out, errDecode
}
if !utf8.Valid(v) {
return out, errInvalidUTF8{}
}
+ sp := p.BytesSlice()
*sp = append(*sp, append(emptyBuf[:], v...))
out.n = n
return out, nil
@@ -5538,25 +5538,25 @@ var coderBytesSliceValidateUTF8 = pointerCoderFuncs{
}
// sizeBytesValue returns the size of wire encoding a []byte value as a Bytes.
-func sizeBytesValue(v protoreflect.Value, tagsize int, _ marshalOptions) int {
+func sizeBytesValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
return tagsize + protowire.SizeBytes(len(v.Bytes()))
}
// appendBytesValue encodes a []byte value as a Bytes.
-func appendBytesValue(b []byte, v protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendBytesValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
b = protowire.AppendVarint(b, wiretag)
b = protowire.AppendBytes(b, v.Bytes())
return b, nil
}
// consumeBytesValue decodes a []byte value as a Bytes.
-func consumeBytesValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeBytesValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
if wtyp != protowire.BytesType {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
out.n = n
return protoreflect.ValueOfBytes(append(emptyBuf[:], v...)), out, nil
@@ -5570,7 +5570,7 @@ var coderBytesValue = valueCoderFuncs{
}
// sizeBytesSliceValue returns the size of wire encoding a [][]byte value as a repeated Bytes.
-func sizeBytesSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions) (size int) {
+func sizeBytesSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -5580,7 +5580,7 @@ func sizeBytesSliceValue(listv protoreflect.Value, tagsize int, _ marshalOptions
}
// appendBytesSliceValue encodes a [][]byte value as a repeated Bytes.
-func appendBytesSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _ marshalOptions) ([]byte, error) {
+func appendBytesSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
list := listv.List()
for i, llen := 0, list.Len(); i < llen; i++ {
v := list.Get(i)
@@ -5591,14 +5591,14 @@ func appendBytesSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, _
}
// consumeBytesSliceValue wire decodes a [][]byte value as a repeated Bytes.
-func consumeBytesSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, _ unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
+func consumeBytesSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
list := listv.List()
if wtyp != protowire.BytesType {
return protoreflect.Value{}, out, errUnknown
}
v, n := protowire.ConsumeBytes(b)
if n < 0 {
- return protoreflect.Value{}, out, protowire.ParseError(n)
+ return protoreflect.Value{}, out, errDecode
}
list.Append(protoreflect.ValueOfBytes(append(emptyBuf[:], v...)))
out.n = n