summaryrefslogtreecommitdiffstats
path: root/vendor/google.golang.org/protobuf/internal/filedesc
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-09-04 23:29:13 +0200
committerGitHub <noreply@github.com>2020-09-04 23:29:13 +0200
commit2f59abdda7a1072036ea1fdb4c859cccbb56efa6 (patch)
treee35393f23d12783ae92f0469085efc7dec953f82 /vendor/google.golang.org/protobuf/internal/filedesc
parent17747a5c8893fd47ba8eb61dd10477170640caf6 (diff)
downloadmatterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.gz
matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.bz2
matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.zip
Update vendor (#1228)
Diffstat (limited to 'vendor/google.golang.org/protobuf/internal/filedesc')
-rw-r--r--vendor/google.golang.org/protobuf/internal/filedesc/build.go16
-rw-r--r--vendor/google.golang.org/protobuf/internal/filedesc/desc.go5
-rw-r--r--vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go62
-rw-r--r--vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go124
-rw-r--r--vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go6
5 files changed, 105 insertions, 108 deletions
diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/build.go b/vendor/google.golang.org/protobuf/internal/filedesc/build.go
index 462d384e..d02d770c 100644
--- a/vendor/google.golang.org/protobuf/internal/filedesc/build.go
+++ b/vendor/google.golang.org/protobuf/internal/filedesc/build.go
@@ -7,7 +7,7 @@ package filedesc
import (
"google.golang.org/protobuf/encoding/protowire"
- "google.golang.org/protobuf/internal/fieldnum"
+ "google.golang.org/protobuf/internal/genid"
"google.golang.org/protobuf/reflect/protoreflect"
pref "google.golang.org/protobuf/reflect/protoreflect"
preg "google.golang.org/protobuf/reflect/protoregistry"
@@ -126,24 +126,24 @@ func (db *Builder) unmarshalCounts(b []byte, isFile bool) {
b = b[m:]
if isFile {
switch num {
- case fieldnum.FileDescriptorProto_EnumType:
+ case genid.FileDescriptorProto_EnumType_field_number:
db.NumEnums++
- case fieldnum.FileDescriptorProto_MessageType:
+ case genid.FileDescriptorProto_MessageType_field_number:
db.unmarshalCounts(v, false)
db.NumMessages++
- case fieldnum.FileDescriptorProto_Extension:
+ case genid.FileDescriptorProto_Extension_field_number:
db.NumExtensions++
- case fieldnum.FileDescriptorProto_Service:
+ case genid.FileDescriptorProto_Service_field_number:
db.NumServices++
}
} else {
switch num {
- case fieldnum.DescriptorProto_EnumType:
+ case genid.DescriptorProto_EnumType_field_number:
db.NumEnums++
- case fieldnum.DescriptorProto_NestedType:
+ case genid.DescriptorProto_NestedType_field_number:
db.unmarshalCounts(v, false)
db.NumMessages++
- case fieldnum.DescriptorProto_Extension:
+ case genid.DescriptorProto_Extension_field_number:
db.NumExtensions++
}
}
diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go
index 2540befd..9385126f 100644
--- a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go
+++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go
@@ -13,6 +13,7 @@ import (
"google.golang.org/protobuf/internal/descfmt"
"google.golang.org/protobuf/internal/descopts"
"google.golang.org/protobuf/internal/encoding/defval"
+ "google.golang.org/protobuf/internal/genid"
"google.golang.org/protobuf/internal/pragma"
"google.golang.org/protobuf/internal/strs"
pref "google.golang.org/protobuf/reflect/protoreflect"
@@ -302,13 +303,13 @@ func (fd *Field) MapKey() pref.FieldDescriptor {
if !fd.IsMap() {
return nil
}
- return fd.Message().Fields().ByNumber(1)
+ return fd.Message().Fields().ByNumber(genid.MapEntry_Key_field_number)
}
func (fd *Field) MapValue() pref.FieldDescriptor {
if !fd.IsMap() {
return nil
}
- return fd.Message().Fields().ByNumber(2)
+ return fd.Message().Fields().ByNumber(genid.MapEntry_Value_field_number)
}
func (fd *Field) HasDefault() bool { return fd.L1.Default.has }
func (fd *Field) Default() pref.Value { return fd.L1.Default.get(fd) }
diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go
index c0cddf86..66e1fee5 100644
--- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go
+++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go
@@ -8,7 +8,7 @@ import (
"sync"
"google.golang.org/protobuf/encoding/protowire"
- "google.golang.org/protobuf/internal/fieldnum"
+ "google.golang.org/protobuf/internal/genid"
"google.golang.org/protobuf/internal/strs"
pref "google.golang.org/protobuf/reflect/protoreflect"
)
@@ -107,7 +107,7 @@ func (fd *File) unmarshalSeed(b []byte) {
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.FileDescriptorProto_Syntax:
+ case genid.FileDescriptorProto_Syntax_field_number:
switch string(v) {
case "proto2":
fd.L1.Syntax = pref.Proto2
@@ -116,36 +116,36 @@ func (fd *File) unmarshalSeed(b []byte) {
default:
panic("invalid syntax")
}
- case fieldnum.FileDescriptorProto_Name:
+ case genid.FileDescriptorProto_Name_field_number:
fd.L1.Path = sb.MakeString(v)
- case fieldnum.FileDescriptorProto_Package:
+ case genid.FileDescriptorProto_Package_field_number:
fd.L1.Package = pref.FullName(sb.MakeString(v))
- case fieldnum.FileDescriptorProto_EnumType:
- if prevField != fieldnum.FileDescriptorProto_EnumType {
+ case genid.FileDescriptorProto_EnumType_field_number:
+ if prevField != genid.FileDescriptorProto_EnumType_field_number {
if numEnums > 0 {
panic("non-contiguous repeated field")
}
posEnums = len(b0) - len(b) - n - m
}
numEnums++
- case fieldnum.FileDescriptorProto_MessageType:
- if prevField != fieldnum.FileDescriptorProto_MessageType {
+ case genid.FileDescriptorProto_MessageType_field_number:
+ if prevField != genid.FileDescriptorProto_MessageType_field_number {
if numMessages > 0 {
panic("non-contiguous repeated field")
}
posMessages = len(b0) - len(b) - n - m
}
numMessages++
- case fieldnum.FileDescriptorProto_Extension:
- if prevField != fieldnum.FileDescriptorProto_Extension {
+ case genid.FileDescriptorProto_Extension_field_number:
+ if prevField != genid.FileDescriptorProto_Extension_field_number {
if numExtensions > 0 {
panic("non-contiguous repeated field")
}
posExtensions = len(b0) - len(b) - n - m
}
numExtensions++
- case fieldnum.FileDescriptorProto_Service:
- if prevField != fieldnum.FileDescriptorProto_Service {
+ case genid.FileDescriptorProto_Service_field_number:
+ if prevField != genid.FileDescriptorProto_Service_field_number {
if numServices > 0 {
panic("non-contiguous repeated field")
}
@@ -233,9 +233,9 @@ func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.Desc
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.EnumDescriptorProto_Name:
+ case genid.EnumDescriptorProto_Name_field_number:
ed.L0.FullName = appendFullName(sb, pd.FullName(), v)
- case fieldnum.EnumDescriptorProto_Value:
+ case genid.EnumDescriptorProto_Value_field_number:
numValues++
}
default:
@@ -260,7 +260,7 @@ func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.Desc
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.EnumDescriptorProto_Value:
+ case genid.EnumDescriptorProto_Value_field_number:
ed.L2.Values.List[i].unmarshalFull(v, sb, pf, ed, i)
i++
}
@@ -288,33 +288,33 @@ func (md *Message) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.D
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.DescriptorProto_Name:
+ case genid.DescriptorProto_Name_field_number:
md.L0.FullName = appendFullName(sb, pd.FullName(), v)
- case fieldnum.DescriptorProto_EnumType:
- if prevField != fieldnum.DescriptorProto_EnumType {
+ case genid.DescriptorProto_EnumType_field_number:
+ if prevField != genid.DescriptorProto_EnumType_field_number {
if numEnums > 0 {
panic("non-contiguous repeated field")
}
posEnums = len(b0) - len(b) - n - m
}
numEnums++
- case fieldnum.DescriptorProto_NestedType:
- if prevField != fieldnum.DescriptorProto_NestedType {
+ case genid.DescriptorProto_NestedType_field_number:
+ if prevField != genid.DescriptorProto_NestedType_field_number {
if numMessages > 0 {
panic("non-contiguous repeated field")
}
posMessages = len(b0) - len(b) - n - m
}
numMessages++
- case fieldnum.DescriptorProto_Extension:
- if prevField != fieldnum.DescriptorProto_Extension {
+ case genid.DescriptorProto_Extension_field_number:
+ if prevField != genid.DescriptorProto_Extension_field_number {
if numExtensions > 0 {
panic("non-contiguous repeated field")
}
posExtensions = len(b0) - len(b) - n - m
}
numExtensions++
- case fieldnum.DescriptorProto_Options:
+ case genid.DescriptorProto_Options_field_number:
md.unmarshalSeedOptions(v)
}
prevField = num
@@ -375,9 +375,9 @@ func (md *Message) unmarshalSeedOptions(b []byte) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.MessageOptions_MapEntry:
+ case genid.MessageOptions_MapEntry_field_number:
md.L1.IsMapEntry = protowire.DecodeBool(v)
- case fieldnum.MessageOptions_MessageSetWireFormat:
+ case genid.MessageOptions_MessageSetWireFormat_field_number:
md.L1.IsMessageSet = protowire.DecodeBool(v)
}
default:
@@ -400,20 +400,20 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.FieldDescriptorProto_Number:
+ case genid.FieldDescriptorProto_Number_field_number:
xd.L1.Number = pref.FieldNumber(v)
- case fieldnum.FieldDescriptorProto_Label:
+ case genid.FieldDescriptorProto_Label_field_number:
xd.L1.Cardinality = pref.Cardinality(v)
- case fieldnum.FieldDescriptorProto_Type:
+ case genid.FieldDescriptorProto_Type_field_number:
xd.L1.Kind = pref.Kind(v)
}
case protowire.BytesType:
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.FieldDescriptorProto_Name:
+ case genid.FieldDescriptorProto_Name_field_number:
xd.L0.FullName = appendFullName(sb, pd.FullName(), v)
- case fieldnum.FieldDescriptorProto_Extendee:
+ case genid.FieldDescriptorProto_Extendee_field_number:
xd.L1.Extendee = PlaceholderMessage(makeFullName(sb, v))
}
default:
@@ -436,7 +436,7 @@ func (sd *Service) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.D
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.ServiceDescriptorProto_Name:
+ case genid.ServiceDescriptorProto_Name_field_number:
sd.L0.FullName = appendFullName(sb, pd.FullName(), v)
}
default:
diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go
index bc215944..e672233e 100644
--- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go
+++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go
@@ -10,7 +10,7 @@ import (
"google.golang.org/protobuf/encoding/protowire"
"google.golang.org/protobuf/internal/descopts"
- "google.golang.org/protobuf/internal/fieldnum"
+ "google.golang.org/protobuf/internal/genid"
"google.golang.org/protobuf/internal/strs"
"google.golang.org/protobuf/proto"
pref "google.golang.org/protobuf/reflect/protoreflect"
@@ -143,35 +143,35 @@ func (fd *File) unmarshalFull(b []byte) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.FileDescriptorProto_PublicDependency:
+ case genid.FileDescriptorProto_PublicDependency_field_number:
fd.L2.Imports[v].IsPublic = true
- case fieldnum.FileDescriptorProto_WeakDependency:
+ case genid.FileDescriptorProto_WeakDependency_field_number:
fd.L2.Imports[v].IsWeak = true
}
case protowire.BytesType:
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.FileDescriptorProto_Dependency:
+ case genid.FileDescriptorProto_Dependency_field_number:
path := sb.MakeString(v)
imp, _ := fd.builder.FileRegistry.FindFileByPath(path)
if imp == nil {
imp = PlaceholderFile(path)
}
fd.L2.Imports = append(fd.L2.Imports, pref.FileImport{FileDescriptor: imp})
- case fieldnum.FileDescriptorProto_EnumType:
+ case genid.FileDescriptorProto_EnumType_field_number:
fd.L1.Enums.List[enumIdx].unmarshalFull(v, sb)
enumIdx++
- case fieldnum.FileDescriptorProto_MessageType:
+ case genid.FileDescriptorProto_MessageType_field_number:
fd.L1.Messages.List[messageIdx].unmarshalFull(v, sb)
messageIdx++
- case fieldnum.FileDescriptorProto_Extension:
+ case genid.FileDescriptorProto_Extension_field_number:
fd.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb)
extensionIdx++
- case fieldnum.FileDescriptorProto_Service:
+ case genid.FileDescriptorProto_Service_field_number:
fd.L1.Services.List[serviceIdx].unmarshalFull(v, sb)
serviceIdx++
- case fieldnum.FileDescriptorProto_Options:
+ case genid.FileDescriptorProto_Options_field_number:
rawOptions = appendOptions(rawOptions, v)
}
default:
@@ -196,13 +196,13 @@ func (ed *Enum) unmarshalFull(b []byte, sb *strs.Builder) {
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.EnumDescriptorProto_Value:
+ case genid.EnumDescriptorProto_Value_field_number:
rawValues = append(rawValues, v)
- case fieldnum.EnumDescriptorProto_ReservedName:
+ case genid.EnumDescriptorProto_ReservedName_field_number:
ed.L2.ReservedNames.List = append(ed.L2.ReservedNames.List, pref.Name(sb.MakeString(v)))
- case fieldnum.EnumDescriptorProto_ReservedRange:
+ case genid.EnumDescriptorProto_ReservedRange_field_number:
ed.L2.ReservedRanges.List = append(ed.L2.ReservedRanges.List, unmarshalEnumReservedRange(v))
- case fieldnum.EnumDescriptorProto_Options:
+ case genid.EnumDescriptorProto_Options_field_number:
rawOptions = appendOptions(rawOptions, v)
}
default:
@@ -228,9 +228,9 @@ func unmarshalEnumReservedRange(b []byte) (r [2]pref.EnumNumber) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.EnumDescriptorProto_EnumReservedRange_Start:
+ case genid.EnumDescriptorProto_EnumReservedRange_Start_field_number:
r[0] = pref.EnumNumber(v)
- case fieldnum.EnumDescriptorProto_EnumReservedRange_End:
+ case genid.EnumDescriptorProto_EnumReservedRange_End_field_number:
r[1] = pref.EnumNumber(v)
}
default:
@@ -255,17 +255,17 @@ func (vd *EnumValue) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.EnumValueDescriptorProto_Number:
+ case genid.EnumValueDescriptorProto_Number_field_number:
vd.L1.Number = pref.EnumNumber(v)
}
case protowire.BytesType:
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.EnumValueDescriptorProto_Name:
+ case genid.EnumValueDescriptorProto_Name_field_number:
// NOTE: Enum values are in the same scope as the enum parent.
vd.L0.FullName = appendFullName(sb, pd.Parent().FullName(), v)
- case fieldnum.EnumValueDescriptorProto_Options:
+ case genid.EnumValueDescriptorProto_Options_field_number:
rawOptions = appendOptions(rawOptions, v)
}
default:
@@ -289,29 +289,29 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) {
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.DescriptorProto_Field:
+ case genid.DescriptorProto_Field_field_number:
rawFields = append(rawFields, v)
- case fieldnum.DescriptorProto_OneofDecl:
+ case genid.DescriptorProto_OneofDecl_field_number:
rawOneofs = append(rawOneofs, v)
- case fieldnum.DescriptorProto_ReservedName:
+ case genid.DescriptorProto_ReservedName_field_number:
md.L2.ReservedNames.List = append(md.L2.ReservedNames.List, pref.Name(sb.MakeString(v)))
- case fieldnum.DescriptorProto_ReservedRange:
+ case genid.DescriptorProto_ReservedRange_field_number:
md.L2.ReservedRanges.List = append(md.L2.ReservedRanges.List, unmarshalMessageReservedRange(v))
- case fieldnum.DescriptorProto_ExtensionRange:
+ case genid.DescriptorProto_ExtensionRange_field_number:
r, rawOptions := unmarshalMessageExtensionRange(v)
opts := md.L0.ParentFile.builder.optionsUnmarshaler(&descopts.ExtensionRange, rawOptions)
md.L2.ExtensionRanges.List = append(md.L2.ExtensionRanges.List, r)
md.L2.ExtensionRangeOptions = append(md.L2.ExtensionRangeOptions, opts)
- case fieldnum.DescriptorProto_EnumType:
+ case genid.DescriptorProto_EnumType_field_number:
md.L1.Enums.List[enumIdx].unmarshalFull(v, sb)
enumIdx++
- case fieldnum.DescriptorProto_NestedType:
+ case genid.DescriptorProto_NestedType_field_number:
md.L1.Messages.List[messageIdx].unmarshalFull(v, sb)
messageIdx++
- case fieldnum.DescriptorProto_Extension:
+ case genid.DescriptorProto_Extension_field_number:
md.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb)
extensionIdx++
- case fieldnum.DescriptorProto_Options:
+ case genid.DescriptorProto_Options_field_number:
md.unmarshalOptions(v)
rawOptions = appendOptions(rawOptions, v)
}
@@ -347,9 +347,9 @@ func (md *Message) unmarshalOptions(b []byte) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.MessageOptions_MapEntry:
+ case genid.MessageOptions_MapEntry_field_number:
md.L1.IsMapEntry = protowire.DecodeBool(v)
- case fieldnum.MessageOptions_MessageSetWireFormat:
+ case genid.MessageOptions_MessageSetWireFormat_field_number:
md.L1.IsMessageSet = protowire.DecodeBool(v)
}
default:
@@ -368,9 +368,9 @@ func unmarshalMessageReservedRange(b []byte) (r [2]pref.FieldNumber) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.DescriptorProto_ReservedRange_Start:
+ case genid.DescriptorProto_ReservedRange_Start_field_number:
r[0] = pref.FieldNumber(v)
- case fieldnum.DescriptorProto_ReservedRange_End:
+ case genid.DescriptorProto_ReservedRange_End_field_number:
r[1] = pref.FieldNumber(v)
}
default:
@@ -390,16 +390,16 @@ func unmarshalMessageExtensionRange(b []byte) (r [2]pref.FieldNumber, rawOptions
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.DescriptorProto_ExtensionRange_Start:
+ case genid.DescriptorProto_ExtensionRange_Start_field_number:
r[0] = pref.FieldNumber(v)
- case fieldnum.DescriptorProto_ExtensionRange_End:
+ case genid.DescriptorProto_ExtensionRange_End_field_number:
r[1] = pref.FieldNumber(v)
}
case protowire.BytesType:
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.DescriptorProto_ExtensionRange_Options:
+ case genid.DescriptorProto_ExtensionRange_Options_field_number:
rawOptions = appendOptions(rawOptions, v)
}
default:
@@ -425,13 +425,13 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Des
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.FieldDescriptorProto_Number:
+ case genid.FieldDescriptorProto_Number_field_number:
fd.L1.Number = pref.FieldNumber(v)
- case fieldnum.FieldDescriptorProto_Label:
+ case genid.FieldDescriptorProto_Label_field_number:
fd.L1.Cardinality = pref.Cardinality(v)
- case fieldnum.FieldDescriptorProto_Type:
+ case genid.FieldDescriptorProto_Type_field_number:
fd.L1.Kind = pref.Kind(v)
- case fieldnum.FieldDescriptorProto_OneofIndex:
+ case genid.FieldDescriptorProto_OneofIndex_field_number:
// In Message.unmarshalFull, we allocate slices for both
// the field and oneof descriptors before unmarshaling either
// of them. This ensures pointers to slice elements are stable.
@@ -441,22 +441,22 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Des
panic("oneof type already set")
}
fd.L1.ContainingOneof = od
- case fieldnum.FieldDescriptorProto_Proto3Optional:
+ case genid.FieldDescriptorProto_Proto3Optional_field_number:
fd.L1.IsProto3Optional = protowire.DecodeBool(v)
}
case protowire.BytesType:
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.FieldDescriptorProto_Name:
+ case genid.FieldDescriptorProto_Name_field_number:
fd.L0.FullName = appendFullName(sb, pd.FullName(), v)
- case fieldnum.FieldDescriptorProto_JsonName:
+ case genid.FieldDescriptorProto_JsonName_field_number:
fd.L1.JSONName.Init(sb.MakeString(v))
- case fieldnum.FieldDescriptorProto_DefaultValue:
+ case genid.FieldDescriptorProto_DefaultValue_field_number:
fd.L1.Default.val = pref.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveMessages
- case fieldnum.FieldDescriptorProto_TypeName:
+ case genid.FieldDescriptorProto_TypeName_field_number:
rawTypeName = v
- case fieldnum.FieldDescriptorProto_Options:
+ case genid.FieldDescriptorProto_Options_field_number:
fd.unmarshalOptions(v)
rawOptions = appendOptions(rawOptions, v)
}
@@ -488,10 +488,10 @@ func (fd *Field) unmarshalOptions(b []byte) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.FieldOptions_Packed:
+ case genid.FieldOptions_Packed_field_number:
fd.L1.HasPacked = true
fd.L1.IsPacked = protowire.DecodeBool(v)
- case fieldnum.FieldOptions_Weak:
+ case genid.FieldOptions_Weak_field_number:
fd.L1.IsWeak = protowire.DecodeBool(v)
case FieldOptions_EnforceUTF8:
fd.L1.HasEnforceUTF8 = true
@@ -518,9 +518,9 @@ func (od *Oneof) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Des
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.OneofDescriptorProto_Name:
+ case genid.OneofDescriptorProto_Name_field_number:
od.L0.FullName = appendFullName(sb, pd.FullName(), v)
- case fieldnum.OneofDescriptorProto_Options:
+ case genid.OneofDescriptorProto_Options_field_number:
rawOptions = appendOptions(rawOptions, v)
}
default:
@@ -543,20 +543,20 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.FieldDescriptorProto_Proto3Optional:
+ case genid.FieldDescriptorProto_Proto3Optional_field_number:
xd.L2.IsProto3Optional = protowire.DecodeBool(v)
}
case protowire.BytesType:
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.FieldDescriptorProto_JsonName:
+ case genid.FieldDescriptorProto_JsonName_field_number:
xd.L2.JSONName.Init(sb.MakeString(v))
- case fieldnum.FieldDescriptorProto_DefaultValue:
+ case genid.FieldDescriptorProto_DefaultValue_field_number:
xd.L2.Default.val = pref.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveExtensions
- case fieldnum.FieldDescriptorProto_TypeName:
+ case genid.FieldDescriptorProto_TypeName_field_number:
rawTypeName = v
- case fieldnum.FieldDescriptorProto_Options:
+ case genid.FieldDescriptorProto_Options_field_number:
xd.unmarshalOptions(v)
rawOptions = appendOptions(rawOptions, v)
}
@@ -586,7 +586,7 @@ func (xd *Extension) unmarshalOptions(b []byte) {
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.FieldOptions_Packed:
+ case genid.FieldOptions_Packed_field_number:
xd.L2.IsPacked = protowire.DecodeBool(v)
}
default:
@@ -608,9 +608,9 @@ func (sd *Service) unmarshalFull(b []byte, sb *strs.Builder) {
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.ServiceDescriptorProto_Method:
+ case genid.ServiceDescriptorProto_Method_field_number:
rawMethods = append(rawMethods, v)
- case fieldnum.ServiceDescriptorProto_Options:
+ case genid.ServiceDescriptorProto_Options_field_number:
rawOptions = appendOptions(rawOptions, v)
}
default:
@@ -641,22 +641,22 @@ func (md *Method) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.De
v, m := protowire.ConsumeVarint(b)
b = b[m:]
switch num {
- case fieldnum.MethodDescriptorProto_ClientStreaming:
+ case genid.MethodDescriptorProto_ClientStreaming_field_number:
md.L1.IsStreamingClient = protowire.DecodeBool(v)
- case fieldnum.MethodDescriptorProto_ServerStreaming:
+ case genid.MethodDescriptorProto_ServerStreaming_field_number:
md.L1.IsStreamingServer = protowire.DecodeBool(v)
}
case protowire.BytesType:
v, m := protowire.ConsumeBytes(b)
b = b[m:]
switch num {
- case fieldnum.MethodDescriptorProto_Name:
+ case genid.MethodDescriptorProto_Name_field_number:
md.L0.FullName = appendFullName(sb, pd.FullName(), v)
- case fieldnum.MethodDescriptorProto_InputType:
+ case genid.MethodDescriptorProto_InputType_field_number:
md.L1.Input = PlaceholderMessage(makeFullName(sb, v))
- case fieldnum.MethodDescriptorProto_OutputType:
+ case genid.MethodDescriptorProto_OutputType_field_number:
md.L1.Output = PlaceholderMessage(makeFullName(sb, v))
- case fieldnum.MethodDescriptorProto_Options:
+ case genid.MethodDescriptorProto_Options_field_number:
rawOptions = appendOptions(rawOptions, v)
}
default:
diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go
index 1b7089b6..c876cd34 100644
--- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go
+++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go
@@ -6,7 +6,6 @@ package filedesc
import (
"fmt"
- "math"
"sort"
"sync"
@@ -185,10 +184,7 @@ func (p *FieldRanges) CheckValid(isMessageSet bool) error {
// Unlike the FieldNumber.IsValid method, it allows ranges that cover the
// reserved number range.
func isValidFieldNumber(n protoreflect.FieldNumber, isMessageSet bool) bool {
- if isMessageSet {
- return protowire.MinValidNumber <= n && n <= math.MaxInt32
- }
- return protowire.MinValidNumber <= n && n <= protowire.MaxValidNumber
+ return protowire.MinValidNumber <= n && (n <= protowire.MaxValidNumber || isMessageSet)
}
// CheckOverlap reports an error if p and q overlap.