// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. package testdata_pulsar import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/gogo/protobuf/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" io "io" reflect "reflect" sync "sync" ) var ( md_Dog protoreflect.MessageDescriptor fd_Dog_size protoreflect.FieldDescriptor fd_Dog_name protoreflect.FieldDescriptor ) func init() { file_testdata_proto_init() md_Dog = File_testdata_proto.Messages().ByName("Dog") fd_Dog_size = md_Dog.Fields().ByName("size") fd_Dog_name = md_Dog.Fields().ByName("name") } var _ protoreflect.Message = (*fastReflection_Dog)(nil) type fastReflection_Dog Dog func (x *Dog) ProtoReflect() protoreflect.Message { return (*fastReflection_Dog)(x) } func (x *Dog) slowProtoReflect() protoreflect.Message { mi := &file_testdata_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } var _fastReflection_Dog_messageType fastReflection_Dog_messageType var _ protoreflect.MessageType = fastReflection_Dog_messageType{} type fastReflection_Dog_messageType struct{} func (x fastReflection_Dog_messageType) Zero() protoreflect.Message { return (*fastReflection_Dog)(nil) } func (x fastReflection_Dog_messageType) New() protoreflect.Message { return new(fastReflection_Dog) } func (x fastReflection_Dog_messageType) Descriptor() protoreflect.MessageDescriptor { return md_Dog } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. func (x *fastReflection_Dog) Descriptor() protoreflect.MessageDescriptor { return md_Dog } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. func (x *fastReflection_Dog) Type() protoreflect.MessageType { return _fastReflection_Dog_messageType } // New returns a newly allocated and mutable empty message. func (x *fastReflection_Dog) New() protoreflect.Message { return new(fastReflection_Dog) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. func (x *fastReflection_Dog) Interface() protoreflect.ProtoMessage { return (*Dog)(x) } // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Dog) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Size != "" { value := protoreflect.ValueOfString(x.Size) if !f(fd_Dog_size, value) { return } } if x.Name != "" { value := protoreflect.ValueOfString(x.Name) if !f(fd_Dog_name, value) { return } } } // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. func (x *fastReflection_Dog) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "testdata.Dog.size": return x.Size != "" case "testdata.Dog.name": return x.Name != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Dog")) } panic(fmt.Errorf("message testdata.Dog does not contain field %s", fd.FullName())) } } // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Dog) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "testdata.Dog.size": x.Size = "" case "testdata.Dog.name": x.Name = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Dog")) } panic(fmt.Errorf("message testdata.Dog does not contain field %s", fd.FullName())) } } // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Dog) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "testdata.Dog.size": value := x.Size return protoreflect.ValueOfString(value) case "testdata.Dog.name": value := x.Name return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Dog")) } panic(fmt.Errorf("message testdata.Dog does not contain field %s", descriptor.FullName())) } } // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Dog) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "testdata.Dog.size": x.Size = value.Interface().(string) case "testdata.Dog.name": x.Name = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Dog")) } panic(fmt.Errorf("message testdata.Dog does not contain field %s", fd.FullName())) } } // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Dog) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.Dog.size": panic(fmt.Errorf("field size of message testdata.Dog is not mutable")) case "testdata.Dog.name": panic(fmt.Errorf("field name of message testdata.Dog is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Dog")) } panic(fmt.Errorf("message testdata.Dog does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Dog) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.Dog.size": return protoreflect.ValueOfString("") case "testdata.Dog.name": return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Dog")) } panic(fmt.Errorf("message testdata.Dog does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_Dog) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: panic(fmt.Errorf("%s is not a oneof field in testdata.Dog", d.FullName())) } panic("unreachable") } // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. func (x *fastReflection_Dog) GetUnknown() protoreflect.RawFields { return x.unknownFields } // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Dog) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. func (x *fastReflection_Dog) IsValid() bool { return x != nil } // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. func (x *fastReflection_Dog) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*Dog) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: 0, } } options := runtime.SizeInputToOptions(input) _ = options var n int var l int _ = l l = len(x.Size) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.Name) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) } return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { x := input.Message.Interface().(*Dog) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } options := runtime.MarshalInputToOptions(input) _ = options size := options.Size(x) dAtA := make([]byte, size) i := len(dAtA) _ = i var l int _ = l if x.unknownFields != nil { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } if len(x.Name) > 0 { i -= len(x.Name) copy(dAtA[i:], x.Name) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) i-- dAtA[i] = 0x12 } if len(x.Size) > 0 { i -= len(x.Size) copy(dAtA[i:], x.Size) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Size))) i-- dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { x := input.Message.Interface().(*Dog) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags, }, nil } options := runtime.UnmarshalInputToOptions(input) _ = options dAtA := input.Buf l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Dog: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Dog: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } x.Size = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } x.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if !options.DiscardUnknown { x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } } if iNdEx > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, Size: size, Marshal: marshal, Unmarshal: unmarshal, Merge: nil, CheckInitialized: nil, } } var ( md_Cat protoreflect.MessageDescriptor fd_Cat_moniker protoreflect.FieldDescriptor fd_Cat_lives protoreflect.FieldDescriptor ) func init() { file_testdata_proto_init() md_Cat = File_testdata_proto.Messages().ByName("Cat") fd_Cat_moniker = md_Cat.Fields().ByName("moniker") fd_Cat_lives = md_Cat.Fields().ByName("lives") } var _ protoreflect.Message = (*fastReflection_Cat)(nil) type fastReflection_Cat Cat func (x *Cat) ProtoReflect() protoreflect.Message { return (*fastReflection_Cat)(x) } func (x *Cat) slowProtoReflect() protoreflect.Message { mi := &file_testdata_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } var _fastReflection_Cat_messageType fastReflection_Cat_messageType var _ protoreflect.MessageType = fastReflection_Cat_messageType{} type fastReflection_Cat_messageType struct{} func (x fastReflection_Cat_messageType) Zero() protoreflect.Message { return (*fastReflection_Cat)(nil) } func (x fastReflection_Cat_messageType) New() protoreflect.Message { return new(fastReflection_Cat) } func (x fastReflection_Cat_messageType) Descriptor() protoreflect.MessageDescriptor { return md_Cat } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. func (x *fastReflection_Cat) Descriptor() protoreflect.MessageDescriptor { return md_Cat } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. func (x *fastReflection_Cat) Type() protoreflect.MessageType { return _fastReflection_Cat_messageType } // New returns a newly allocated and mutable empty message. func (x *fastReflection_Cat) New() protoreflect.Message { return new(fastReflection_Cat) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. func (x *fastReflection_Cat) Interface() protoreflect.ProtoMessage { return (*Cat)(x) } // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Cat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Moniker != "" { value := protoreflect.ValueOfString(x.Moniker) if !f(fd_Cat_moniker, value) { return } } if x.Lives != int32(0) { value := protoreflect.ValueOfInt32(x.Lives) if !f(fd_Cat_lives, value) { return } } } // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. func (x *fastReflection_Cat) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "testdata.Cat.moniker": return x.Moniker != "" case "testdata.Cat.lives": return x.Lives != int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Cat")) } panic(fmt.Errorf("message testdata.Cat does not contain field %s", fd.FullName())) } } // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Cat) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "testdata.Cat.moniker": x.Moniker = "" case "testdata.Cat.lives": x.Lives = int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Cat")) } panic(fmt.Errorf("message testdata.Cat does not contain field %s", fd.FullName())) } } // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Cat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "testdata.Cat.moniker": value := x.Moniker return protoreflect.ValueOfString(value) case "testdata.Cat.lives": value := x.Lives return protoreflect.ValueOfInt32(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Cat")) } panic(fmt.Errorf("message testdata.Cat does not contain field %s", descriptor.FullName())) } } // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Cat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "testdata.Cat.moniker": x.Moniker = value.Interface().(string) case "testdata.Cat.lives": x.Lives = int32(value.Int()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Cat")) } panic(fmt.Errorf("message testdata.Cat does not contain field %s", fd.FullName())) } } // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Cat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.Cat.moniker": panic(fmt.Errorf("field moniker of message testdata.Cat is not mutable")) case "testdata.Cat.lives": panic(fmt.Errorf("field lives of message testdata.Cat is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Cat")) } panic(fmt.Errorf("message testdata.Cat does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Cat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.Cat.moniker": return protoreflect.ValueOfString("") case "testdata.Cat.lives": return protoreflect.ValueOfInt32(int32(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.Cat")) } panic(fmt.Errorf("message testdata.Cat does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_Cat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: panic(fmt.Errorf("%s is not a oneof field in testdata.Cat", d.FullName())) } panic("unreachable") } // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. func (x *fastReflection_Cat) GetUnknown() protoreflect.RawFields { return x.unknownFields } // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Cat) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. func (x *fastReflection_Cat) IsValid() bool { return x != nil } // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. func (x *fastReflection_Cat) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*Cat) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: 0, } } options := runtime.SizeInputToOptions(input) _ = options var n int var l int _ = l l = len(x.Moniker) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.Lives != 0 { n += 1 + runtime.Sov(uint64(x.Lives)) } if x.unknownFields != nil { n += len(x.unknownFields) } return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { x := input.Message.Interface().(*Cat) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } options := runtime.MarshalInputToOptions(input) _ = options size := options.Size(x) dAtA := make([]byte, size) i := len(dAtA) _ = i var l int _ = l if x.unknownFields != nil { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } if x.Lives != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Lives)) i-- dAtA[i] = 0x10 } if len(x.Moniker) > 0 { i -= len(x.Moniker) copy(dAtA[i:], x.Moniker) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Moniker))) i-- dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { x := input.Message.Interface().(*Cat) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags, }, nil } options := runtime.UnmarshalInputToOptions(input) _ = options dAtA := input.Buf l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Cat: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Cat: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } x.Moniker = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Lives", wireType) } x.Lives = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ x.Lives |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if !options.DiscardUnknown { x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } } if iNdEx > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, Size: size, Marshal: marshal, Unmarshal: unmarshal, Merge: nil, CheckInitialized: nil, } } var ( md_HasAnimal protoreflect.MessageDescriptor fd_HasAnimal_animal protoreflect.FieldDescriptor fd_HasAnimal_x protoreflect.FieldDescriptor ) func init() { file_testdata_proto_init() md_HasAnimal = File_testdata_proto.Messages().ByName("HasAnimal") fd_HasAnimal_animal = md_HasAnimal.Fields().ByName("animal") fd_HasAnimal_x = md_HasAnimal.Fields().ByName("x") } var _ protoreflect.Message = (*fastReflection_HasAnimal)(nil) type fastReflection_HasAnimal HasAnimal func (x *HasAnimal) ProtoReflect() protoreflect.Message { return (*fastReflection_HasAnimal)(x) } func (x *HasAnimal) slowProtoReflect() protoreflect.Message { mi := &file_testdata_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } var _fastReflection_HasAnimal_messageType fastReflection_HasAnimal_messageType var _ protoreflect.MessageType = fastReflection_HasAnimal_messageType{} type fastReflection_HasAnimal_messageType struct{} func (x fastReflection_HasAnimal_messageType) Zero() protoreflect.Message { return (*fastReflection_HasAnimal)(nil) } func (x fastReflection_HasAnimal_messageType) New() protoreflect.Message { return new(fastReflection_HasAnimal) } func (x fastReflection_HasAnimal_messageType) Descriptor() protoreflect.MessageDescriptor { return md_HasAnimal } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. func (x *fastReflection_HasAnimal) Descriptor() protoreflect.MessageDescriptor { return md_HasAnimal } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. func (x *fastReflection_HasAnimal) Type() protoreflect.MessageType { return _fastReflection_HasAnimal_messageType } // New returns a newly allocated and mutable empty message. func (x *fastReflection_HasAnimal) New() protoreflect.Message { return new(fastReflection_HasAnimal) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. func (x *fastReflection_HasAnimal) Interface() protoreflect.ProtoMessage { return (*HasAnimal)(x) } // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_HasAnimal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Animal != nil { value := protoreflect.ValueOfMessage(x.Animal.ProtoReflect()) if !f(fd_HasAnimal_animal, value) { return } } if x.X != int64(0) { value := protoreflect.ValueOfInt64(x.X) if !f(fd_HasAnimal_x, value) { return } } } // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. func (x *fastReflection_HasAnimal) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "testdata.HasAnimal.animal": return x.Animal != nil case "testdata.HasAnimal.x": return x.X != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasAnimal")) } panic(fmt.Errorf("message testdata.HasAnimal does not contain field %s", fd.FullName())) } } // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasAnimal) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "testdata.HasAnimal.animal": x.Animal = nil case "testdata.HasAnimal.x": x.X = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasAnimal")) } panic(fmt.Errorf("message testdata.HasAnimal does not contain field %s", fd.FullName())) } } // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_HasAnimal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "testdata.HasAnimal.animal": value := x.Animal return protoreflect.ValueOfMessage(value.ProtoReflect()) case "testdata.HasAnimal.x": value := x.X return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasAnimal")) } panic(fmt.Errorf("message testdata.HasAnimal does not contain field %s", descriptor.FullName())) } } // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasAnimal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "testdata.HasAnimal.animal": x.Animal = value.Message().Interface().(*anypb.Any) case "testdata.HasAnimal.x": x.X = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasAnimal")) } panic(fmt.Errorf("message testdata.HasAnimal does not contain field %s", fd.FullName())) } } // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasAnimal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.HasAnimal.animal": if x.Animal == nil { x.Animal = new(anypb.Any) } return protoreflect.ValueOfMessage(x.Animal.ProtoReflect()) case "testdata.HasAnimal.x": panic(fmt.Errorf("field x of message testdata.HasAnimal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasAnimal")) } panic(fmt.Errorf("message testdata.HasAnimal does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_HasAnimal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.HasAnimal.animal": m := new(anypb.Any) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "testdata.HasAnimal.x": return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasAnimal")) } panic(fmt.Errorf("message testdata.HasAnimal does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_HasAnimal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: panic(fmt.Errorf("%s is not a oneof field in testdata.HasAnimal", d.FullName())) } panic("unreachable") } // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. func (x *fastReflection_HasAnimal) GetUnknown() protoreflect.RawFields { return x.unknownFields } // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasAnimal) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. func (x *fastReflection_HasAnimal) IsValid() bool { return x != nil } // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. func (x *fastReflection_HasAnimal) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*HasAnimal) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: 0, } } options := runtime.SizeInputToOptions(input) _ = options var n int var l int _ = l if x.Animal != nil { l = options.Size(x.Animal) n += 1 + l + runtime.Sov(uint64(l)) } if x.X != 0 { n += 1 + runtime.Sov(uint64(x.X)) } if x.unknownFields != nil { n += len(x.unknownFields) } return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { x := input.Message.Interface().(*HasAnimal) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } options := runtime.MarshalInputToOptions(input) _ = options size := options.Size(x) dAtA := make([]byte, size) i := len(dAtA) _ = i var l int _ = l if x.unknownFields != nil { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } if x.X != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.X)) i-- dAtA[i] = 0x10 } if x.Animal != nil { encoded, err := options.Marshal(x.Animal) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, err } i -= len(encoded) copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { x := input.Message.Interface().(*HasAnimal) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags, }, nil } options := runtime.UnmarshalInputToOptions(input) _ = options dAtA := input.Buf l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasAnimal: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Animal", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Animal == nil { x.Animal = &anypb.Any{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Animal); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex case 2: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field X", wireType) } x.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ x.X |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if !options.DiscardUnknown { x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } } if iNdEx > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, Size: size, Marshal: marshal, Unmarshal: unmarshal, Merge: nil, CheckInitialized: nil, } } var ( md_HasHasAnimal protoreflect.MessageDescriptor fd_HasHasAnimal_has_animal protoreflect.FieldDescriptor ) func init() { file_testdata_proto_init() md_HasHasAnimal = File_testdata_proto.Messages().ByName("HasHasAnimal") fd_HasHasAnimal_has_animal = md_HasHasAnimal.Fields().ByName("has_animal") } var _ protoreflect.Message = (*fastReflection_HasHasAnimal)(nil) type fastReflection_HasHasAnimal HasHasAnimal func (x *HasHasAnimal) ProtoReflect() protoreflect.Message { return (*fastReflection_HasHasAnimal)(x) } func (x *HasHasAnimal) slowProtoReflect() protoreflect.Message { mi := &file_testdata_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } var _fastReflection_HasHasAnimal_messageType fastReflection_HasHasAnimal_messageType var _ protoreflect.MessageType = fastReflection_HasHasAnimal_messageType{} type fastReflection_HasHasAnimal_messageType struct{} func (x fastReflection_HasHasAnimal_messageType) Zero() protoreflect.Message { return (*fastReflection_HasHasAnimal)(nil) } func (x fastReflection_HasHasAnimal_messageType) New() protoreflect.Message { return new(fastReflection_HasHasAnimal) } func (x fastReflection_HasHasAnimal_messageType) Descriptor() protoreflect.MessageDescriptor { return md_HasHasAnimal } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. func (x *fastReflection_HasHasAnimal) Descriptor() protoreflect.MessageDescriptor { return md_HasHasAnimal } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. func (x *fastReflection_HasHasAnimal) Type() protoreflect.MessageType { return _fastReflection_HasHasAnimal_messageType } // New returns a newly allocated and mutable empty message. func (x *fastReflection_HasHasAnimal) New() protoreflect.Message { return new(fastReflection_HasHasAnimal) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. func (x *fastReflection_HasHasAnimal) Interface() protoreflect.ProtoMessage { return (*HasHasAnimal)(x) } // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_HasHasAnimal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.HasAnimal != nil { value := protoreflect.ValueOfMessage(x.HasAnimal.ProtoReflect()) if !f(fd_HasHasAnimal_has_animal, value) { return } } } // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. func (x *fastReflection_HasHasAnimal) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "testdata.HasHasAnimal.has_animal": return x.HasAnimal != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasAnimal does not contain field %s", fd.FullName())) } } // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasAnimal) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "testdata.HasHasAnimal.has_animal": x.HasAnimal = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasAnimal does not contain field %s", fd.FullName())) } } // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_HasHasAnimal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "testdata.HasHasAnimal.has_animal": value := x.HasAnimal return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasAnimal does not contain field %s", descriptor.FullName())) } } // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasAnimal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "testdata.HasHasAnimal.has_animal": x.HasAnimal = value.Message().Interface().(*anypb.Any) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasAnimal does not contain field %s", fd.FullName())) } } // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasAnimal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.HasHasAnimal.has_animal": if x.HasAnimal == nil { x.HasAnimal = new(anypb.Any) } return protoreflect.ValueOfMessage(x.HasAnimal.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasAnimal does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_HasHasAnimal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.HasHasAnimal.has_animal": m := new(anypb.Any) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasAnimal does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_HasHasAnimal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: panic(fmt.Errorf("%s is not a oneof field in testdata.HasHasAnimal", d.FullName())) } panic("unreachable") } // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. func (x *fastReflection_HasHasAnimal) GetUnknown() protoreflect.RawFields { return x.unknownFields } // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasAnimal) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. func (x *fastReflection_HasHasAnimal) IsValid() bool { return x != nil } // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. func (x *fastReflection_HasHasAnimal) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*HasHasAnimal) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: 0, } } options := runtime.SizeInputToOptions(input) _ = options var n int var l int _ = l if x.HasAnimal != nil { l = options.Size(x.HasAnimal) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) } return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { x := input.Message.Interface().(*HasHasAnimal) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } options := runtime.MarshalInputToOptions(input) _ = options size := options.Size(x) dAtA := make([]byte, size) i := len(dAtA) _ = i var l int _ = l if x.unknownFields != nil { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } if x.HasAnimal != nil { encoded, err := options.Marshal(x.HasAnimal) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, err } i -= len(encoded) copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { x := input.Message.Interface().(*HasHasAnimal) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags, }, nil } options := runtime.UnmarshalInputToOptions(input) _ = options dAtA := input.Buf l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasAnimal: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.HasAnimal == nil { x.HasAnimal = &anypb.Any{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.HasAnimal); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if !options.DiscardUnknown { x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } } if iNdEx > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, Size: size, Marshal: marshal, Unmarshal: unmarshal, Merge: nil, CheckInitialized: nil, } } var ( md_HasHasHasAnimal protoreflect.MessageDescriptor fd_HasHasHasAnimal_has_has_animal protoreflect.FieldDescriptor ) func init() { file_testdata_proto_init() md_HasHasHasAnimal = File_testdata_proto.Messages().ByName("HasHasHasAnimal") fd_HasHasHasAnimal_has_has_animal = md_HasHasHasAnimal.Fields().ByName("has_has_animal") } var _ protoreflect.Message = (*fastReflection_HasHasHasAnimal)(nil) type fastReflection_HasHasHasAnimal HasHasHasAnimal func (x *HasHasHasAnimal) ProtoReflect() protoreflect.Message { return (*fastReflection_HasHasHasAnimal)(x) } func (x *HasHasHasAnimal) slowProtoReflect() protoreflect.Message { mi := &file_testdata_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } var _fastReflection_HasHasHasAnimal_messageType fastReflection_HasHasHasAnimal_messageType var _ protoreflect.MessageType = fastReflection_HasHasHasAnimal_messageType{} type fastReflection_HasHasHasAnimal_messageType struct{} func (x fastReflection_HasHasHasAnimal_messageType) Zero() protoreflect.Message { return (*fastReflection_HasHasHasAnimal)(nil) } func (x fastReflection_HasHasHasAnimal_messageType) New() protoreflect.Message { return new(fastReflection_HasHasHasAnimal) } func (x fastReflection_HasHasHasAnimal_messageType) Descriptor() protoreflect.MessageDescriptor { return md_HasHasHasAnimal } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. func (x *fastReflection_HasHasHasAnimal) Descriptor() protoreflect.MessageDescriptor { return md_HasHasHasAnimal } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. func (x *fastReflection_HasHasHasAnimal) Type() protoreflect.MessageType { return _fastReflection_HasHasHasAnimal_messageType } // New returns a newly allocated and mutable empty message. func (x *fastReflection_HasHasHasAnimal) New() protoreflect.Message { return new(fastReflection_HasHasHasAnimal) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. func (x *fastReflection_HasHasHasAnimal) Interface() protoreflect.ProtoMessage { return (*HasHasHasAnimal)(x) } // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_HasHasHasAnimal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.HasHasAnimal != nil { value := protoreflect.ValueOfMessage(x.HasHasAnimal.ProtoReflect()) if !f(fd_HasHasHasAnimal_has_has_animal, value) { return } } } // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. func (x *fastReflection_HasHasHasAnimal) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "testdata.HasHasHasAnimal.has_has_animal": return x.HasHasAnimal != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasHasAnimal does not contain field %s", fd.FullName())) } } // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasHasAnimal) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "testdata.HasHasHasAnimal.has_has_animal": x.HasHasAnimal = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasHasAnimal does not contain field %s", fd.FullName())) } } // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_HasHasHasAnimal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "testdata.HasHasHasAnimal.has_has_animal": value := x.HasHasAnimal return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasHasAnimal does not contain field %s", descriptor.FullName())) } } // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasHasAnimal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "testdata.HasHasHasAnimal.has_has_animal": x.HasHasAnimal = value.Message().Interface().(*anypb.Any) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasHasAnimal does not contain field %s", fd.FullName())) } } // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasHasAnimal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.HasHasHasAnimal.has_has_animal": if x.HasHasAnimal == nil { x.HasHasAnimal = new(anypb.Any) } return protoreflect.ValueOfMessage(x.HasHasAnimal.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasHasAnimal does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_HasHasHasAnimal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.HasHasHasAnimal.has_has_animal": m := new(anypb.Any) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.HasHasHasAnimal")) } panic(fmt.Errorf("message testdata.HasHasHasAnimal does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_HasHasHasAnimal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: panic(fmt.Errorf("%s is not a oneof field in testdata.HasHasHasAnimal", d.FullName())) } panic("unreachable") } // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. func (x *fastReflection_HasHasHasAnimal) GetUnknown() protoreflect.RawFields { return x.unknownFields } // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. func (x *fastReflection_HasHasHasAnimal) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. func (x *fastReflection_HasHasHasAnimal) IsValid() bool { return x != nil } // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. func (x *fastReflection_HasHasHasAnimal) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*HasHasHasAnimal) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: 0, } } options := runtime.SizeInputToOptions(input) _ = options var n int var l int _ = l if x.HasHasAnimal != nil { l = options.Size(x.HasHasAnimal) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) } return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { x := input.Message.Interface().(*HasHasHasAnimal) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } options := runtime.MarshalInputToOptions(input) _ = options size := options.Size(x) dAtA := make([]byte, size) i := len(dAtA) _ = i var l int _ = l if x.unknownFields != nil { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } if x.HasHasAnimal != nil { encoded, err := options.Marshal(x.HasHasAnimal) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, err } i -= len(encoded) copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { x := input.Message.Interface().(*HasHasHasAnimal) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags, }, nil } options := runtime.UnmarshalInputToOptions(input) _ = options dAtA := input.Buf l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasHasAnimal: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HasHasAnimal", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.HasHasAnimal == nil { x.HasHasAnimal = &anypb.Any{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.HasHasAnimal); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if !options.DiscardUnknown { x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } } if iNdEx > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, Size: size, Marshal: marshal, Unmarshal: unmarshal, Merge: nil, CheckInitialized: nil, } } var _ protoreflect.List = (*_BadMultiSignature_1_list)(nil) type _BadMultiSignature_1_list struct { list *[][]byte } func (x *_BadMultiSignature_1_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } func (x *_BadMultiSignature_1_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfBytes((*x.list)[i]) } func (x *_BadMultiSignature_1_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Bytes() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } func (x *_BadMultiSignature_1_list) Append(value protoreflect.Value) { valueUnwrapped := value.Bytes() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } func (x *_BadMultiSignature_1_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message BadMultiSignature at list field Signatures as it is not of Message kind")) } func (x *_BadMultiSignature_1_list) Truncate(n int) { *x.list = (*x.list)[:n] } func (x *_BadMultiSignature_1_list) NewElement() protoreflect.Value { var v []byte return protoreflect.ValueOfBytes(v) } func (x *_BadMultiSignature_1_list) IsValid() bool { return x.list != nil } var ( md_BadMultiSignature protoreflect.MessageDescriptor fd_BadMultiSignature_signatures protoreflect.FieldDescriptor fd_BadMultiSignature_malicious_field protoreflect.FieldDescriptor ) func init() { file_testdata_proto_init() md_BadMultiSignature = File_testdata_proto.Messages().ByName("BadMultiSignature") fd_BadMultiSignature_signatures = md_BadMultiSignature.Fields().ByName("signatures") fd_BadMultiSignature_malicious_field = md_BadMultiSignature.Fields().ByName("malicious_field") } var _ protoreflect.Message = (*fastReflection_BadMultiSignature)(nil) type fastReflection_BadMultiSignature BadMultiSignature func (x *BadMultiSignature) ProtoReflect() protoreflect.Message { return (*fastReflection_BadMultiSignature)(x) } func (x *BadMultiSignature) slowProtoReflect() protoreflect.Message { mi := &file_testdata_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } var _fastReflection_BadMultiSignature_messageType fastReflection_BadMultiSignature_messageType var _ protoreflect.MessageType = fastReflection_BadMultiSignature_messageType{} type fastReflection_BadMultiSignature_messageType struct{} func (x fastReflection_BadMultiSignature_messageType) Zero() protoreflect.Message { return (*fastReflection_BadMultiSignature)(nil) } func (x fastReflection_BadMultiSignature_messageType) New() protoreflect.Message { return new(fastReflection_BadMultiSignature) } func (x fastReflection_BadMultiSignature_messageType) Descriptor() protoreflect.MessageDescriptor { return md_BadMultiSignature } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. func (x *fastReflection_BadMultiSignature) Descriptor() protoreflect.MessageDescriptor { return md_BadMultiSignature } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. func (x *fastReflection_BadMultiSignature) Type() protoreflect.MessageType { return _fastReflection_BadMultiSignature_messageType } // New returns a newly allocated and mutable empty message. func (x *fastReflection_BadMultiSignature) New() protoreflect.Message { return new(fastReflection_BadMultiSignature) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. func (x *fastReflection_BadMultiSignature) Interface() protoreflect.ProtoMessage { return (*BadMultiSignature)(x) } // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_BadMultiSignature) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if len(x.Signatures) != 0 { value := protoreflect.ValueOfList(&_BadMultiSignature_1_list{list: &x.Signatures}) if !f(fd_BadMultiSignature_signatures, value) { return } } if len(x.MaliciousField) != 0 { value := protoreflect.ValueOfBytes(x.MaliciousField) if !f(fd_BadMultiSignature_malicious_field, value) { return } } } // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. func (x *fastReflection_BadMultiSignature) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "testdata.BadMultiSignature.signatures": return len(x.Signatures) != 0 case "testdata.BadMultiSignature.malicious_field": return len(x.MaliciousField) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.BadMultiSignature")) } panic(fmt.Errorf("message testdata.BadMultiSignature does not contain field %s", fd.FullName())) } } // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_BadMultiSignature) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "testdata.BadMultiSignature.signatures": x.Signatures = nil case "testdata.BadMultiSignature.malicious_field": x.MaliciousField = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.BadMultiSignature")) } panic(fmt.Errorf("message testdata.BadMultiSignature does not contain field %s", fd.FullName())) } } // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_BadMultiSignature) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "testdata.BadMultiSignature.signatures": if len(x.Signatures) == 0 { return protoreflect.ValueOfList(&_BadMultiSignature_1_list{}) } listValue := &_BadMultiSignature_1_list{list: &x.Signatures} return protoreflect.ValueOfList(listValue) case "testdata.BadMultiSignature.malicious_field": value := x.MaliciousField return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.BadMultiSignature")) } panic(fmt.Errorf("message testdata.BadMultiSignature does not contain field %s", descriptor.FullName())) } } // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_BadMultiSignature) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "testdata.BadMultiSignature.signatures": lv := value.List() clv := lv.(*_BadMultiSignature_1_list) x.Signatures = *clv.list case "testdata.BadMultiSignature.malicious_field": x.MaliciousField = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.BadMultiSignature")) } panic(fmt.Errorf("message testdata.BadMultiSignature does not contain field %s", fd.FullName())) } } // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_BadMultiSignature) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.BadMultiSignature.signatures": if x.Signatures == nil { x.Signatures = [][]byte{} } value := &_BadMultiSignature_1_list{list: &x.Signatures} return protoreflect.ValueOfList(value) case "testdata.BadMultiSignature.malicious_field": panic(fmt.Errorf("field malicious_field of message testdata.BadMultiSignature is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.BadMultiSignature")) } panic(fmt.Errorf("message testdata.BadMultiSignature does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_BadMultiSignature) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.BadMultiSignature.signatures": list := [][]byte{} return protoreflect.ValueOfList(&_BadMultiSignature_1_list{list: &list}) case "testdata.BadMultiSignature.malicious_field": return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.BadMultiSignature")) } panic(fmt.Errorf("message testdata.BadMultiSignature does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_BadMultiSignature) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: panic(fmt.Errorf("%s is not a oneof field in testdata.BadMultiSignature", d.FullName())) } panic("unreachable") } // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. func (x *fastReflection_BadMultiSignature) GetUnknown() protoreflect.RawFields { return x.unknownFields } // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. func (x *fastReflection_BadMultiSignature) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. func (x *fastReflection_BadMultiSignature) IsValid() bool { return x != nil } // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. func (x *fastReflection_BadMultiSignature) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*BadMultiSignature) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: 0, } } options := runtime.SizeInputToOptions(input) _ = options var n int var l int _ = l if len(x.Signatures) > 0 { for _, b := range x.Signatures { l = len(b) n += 1 + l + runtime.Sov(uint64(l)) } } l = len(x.MaliciousField) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) } return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { x := input.Message.Interface().(*BadMultiSignature) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } options := runtime.MarshalInputToOptions(input) _ = options size := options.Size(x) dAtA := make([]byte, size) i := len(dAtA) _ = i var l int _ = l if x.unknownFields != nil { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } if len(x.MaliciousField) > 0 { i -= len(x.MaliciousField) copy(dAtA[i:], x.MaliciousField) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaliciousField))) i-- dAtA[i] = 0x2a } if len(x.Signatures) > 0 { for iNdEx := len(x.Signatures) - 1; iNdEx >= 0; iNdEx-- { i -= len(x.Signatures[iNdEx]) copy(dAtA[i:], x.Signatures[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signatures[iNdEx]))) i-- dAtA[i] = 0xa } } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { x := input.Message.Interface().(*BadMultiSignature) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags, }, nil } options := runtime.UnmarshalInputToOptions(input) _ = options dAtA := input.Buf l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadMultiSignature: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadMultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } x.Signatures = append(x.Signatures, make([]byte, postIndex-iNdEx)) copy(x.Signatures[len(x.Signatures)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaliciousField", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } x.MaliciousField = append(x.MaliciousField[:0], dAtA[iNdEx:postIndex]...) if x.MaliciousField == nil { x.MaliciousField = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if !options.DiscardUnknown { x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } } if iNdEx > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, Size: size, Marshal: marshal, Unmarshal: unmarshal, Merge: nil, CheckInitialized: nil, } } var ( md_TableModel protoreflect.MessageDescriptor fd_TableModel_id protoreflect.FieldDescriptor fd_TableModel_name protoreflect.FieldDescriptor fd_TableModel_number protoreflect.FieldDescriptor fd_TableModel_metadata protoreflect.FieldDescriptor ) func init() { file_testdata_proto_init() md_TableModel = File_testdata_proto.Messages().ByName("TableModel") fd_TableModel_id = md_TableModel.Fields().ByName("id") fd_TableModel_name = md_TableModel.Fields().ByName("name") fd_TableModel_number = md_TableModel.Fields().ByName("number") fd_TableModel_metadata = md_TableModel.Fields().ByName("metadata") } var _ protoreflect.Message = (*fastReflection_TableModel)(nil) type fastReflection_TableModel TableModel func (x *TableModel) ProtoReflect() protoreflect.Message { return (*fastReflection_TableModel)(x) } func (x *TableModel) slowProtoReflect() protoreflect.Message { mi := &file_testdata_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } var _fastReflection_TableModel_messageType fastReflection_TableModel_messageType var _ protoreflect.MessageType = fastReflection_TableModel_messageType{} type fastReflection_TableModel_messageType struct{} func (x fastReflection_TableModel_messageType) Zero() protoreflect.Message { return (*fastReflection_TableModel)(nil) } func (x fastReflection_TableModel_messageType) New() protoreflect.Message { return new(fastReflection_TableModel) } func (x fastReflection_TableModel_messageType) Descriptor() protoreflect.MessageDescriptor { return md_TableModel } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. func (x *fastReflection_TableModel) Descriptor() protoreflect.MessageDescriptor { return md_TableModel } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. func (x *fastReflection_TableModel) Type() protoreflect.MessageType { return _fastReflection_TableModel_messageType } // New returns a newly allocated and mutable empty message. func (x *fastReflection_TableModel) New() protoreflect.Message { return new(fastReflection_TableModel) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. func (x *fastReflection_TableModel) Interface() protoreflect.ProtoMessage { return (*TableModel)(x) } // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_TableModel) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != uint64(0) { value := protoreflect.ValueOfUint64(x.Id) if !f(fd_TableModel_id, value) { return } } if x.Name != "" { value := protoreflect.ValueOfString(x.Name) if !f(fd_TableModel_name, value) { return } } if x.Number != uint64(0) { value := protoreflect.ValueOfUint64(x.Number) if !f(fd_TableModel_number, value) { return } } if len(x.Metadata) != 0 { value := protoreflect.ValueOfBytes(x.Metadata) if !f(fd_TableModel_metadata, value) { return } } } // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. func (x *fastReflection_TableModel) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "testdata.TableModel.id": return x.Id != uint64(0) case "testdata.TableModel.name": return x.Name != "" case "testdata.TableModel.number": return x.Number != uint64(0) case "testdata.TableModel.metadata": return len(x.Metadata) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.TableModel")) } panic(fmt.Errorf("message testdata.TableModel does not contain field %s", fd.FullName())) } } // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TableModel) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "testdata.TableModel.id": x.Id = uint64(0) case "testdata.TableModel.name": x.Name = "" case "testdata.TableModel.number": x.Number = uint64(0) case "testdata.TableModel.metadata": x.Metadata = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.TableModel")) } panic(fmt.Errorf("message testdata.TableModel does not contain field %s", fd.FullName())) } } // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_TableModel) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "testdata.TableModel.id": value := x.Id return protoreflect.ValueOfUint64(value) case "testdata.TableModel.name": value := x.Name return protoreflect.ValueOfString(value) case "testdata.TableModel.number": value := x.Number return protoreflect.ValueOfUint64(value) case "testdata.TableModel.metadata": value := x.Metadata return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.TableModel")) } panic(fmt.Errorf("message testdata.TableModel does not contain field %s", descriptor.FullName())) } } // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TableModel) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "testdata.TableModel.id": x.Id = value.Uint() case "testdata.TableModel.name": x.Name = value.Interface().(string) case "testdata.TableModel.number": x.Number = value.Uint() case "testdata.TableModel.metadata": x.Metadata = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.TableModel")) } panic(fmt.Errorf("message testdata.TableModel does not contain field %s", fd.FullName())) } } // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TableModel) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.TableModel.id": panic(fmt.Errorf("field id of message testdata.TableModel is not mutable")) case "testdata.TableModel.name": panic(fmt.Errorf("field name of message testdata.TableModel is not mutable")) case "testdata.TableModel.number": panic(fmt.Errorf("field number of message testdata.TableModel is not mutable")) case "testdata.TableModel.metadata": panic(fmt.Errorf("field metadata of message testdata.TableModel is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.TableModel")) } panic(fmt.Errorf("message testdata.TableModel does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_TableModel) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "testdata.TableModel.id": return protoreflect.ValueOfUint64(uint64(0)) case "testdata.TableModel.name": return protoreflect.ValueOfString("") case "testdata.TableModel.number": return protoreflect.ValueOfUint64(uint64(0)) case "testdata.TableModel.metadata": return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testdata.TableModel")) } panic(fmt.Errorf("message testdata.TableModel does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_TableModel) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: panic(fmt.Errorf("%s is not a oneof field in testdata.TableModel", d.FullName())) } panic("unreachable") } // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. func (x *fastReflection_TableModel) GetUnknown() protoreflect.RawFields { return x.unknownFields } // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TableModel) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. func (x *fastReflection_TableModel) IsValid() bool { return x != nil } // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. func (x *fastReflection_TableModel) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*TableModel) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: 0, } } options := runtime.SizeInputToOptions(input) _ = options var n int var l int _ = l if x.Id != 0 { n += 1 + runtime.Sov(uint64(x.Id)) } l = len(x.Name) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.Number != 0 { n += 1 + runtime.Sov(uint64(x.Number)) } l = len(x.Metadata) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) } return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { x := input.Message.Interface().(*TableModel) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } options := runtime.MarshalInputToOptions(input) _ = options size := options.Size(x) dAtA := make([]byte, size) i := len(dAtA) _ = i var l int _ = l if x.unknownFields != nil { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } if len(x.Metadata) > 0 { i -= len(x.Metadata) copy(dAtA[i:], x.Metadata) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata))) i-- dAtA[i] = 0x22 } if x.Number != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Number)) i-- dAtA[i] = 0x18 } if len(x.Name) > 0 { i -= len(x.Name) copy(dAtA[i:], x.Name) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) i-- dAtA[i] = 0x12 } if x.Id != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) i-- dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Buf: input.Buf, }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { x := input.Message.Interface().(*TableModel) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags, }, nil } options := runtime.UnmarshalInputToOptions(input) _ = options dAtA := input.Buf l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TableModel: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TableModel: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } x.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ x.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } x.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) } x.Number = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ x.Number |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } x.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) if x.Metadata == nil { x.Metadata = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if !options.DiscardUnknown { x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } } if iNdEx > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, Size: size, Marshal: marshal, Unmarshal: unmarshal, Merge: nil, CheckInitialized: nil, } } // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 // protoc (unknown) // source: testdata.proto const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Dog struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Size string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } func (x *Dog) Reset() { *x = Dog{} if protoimpl.UnsafeEnabled { mi := &file_testdata_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Dog) String() string { return protoimpl.X.MessageStringOf(x) } func (*Dog) ProtoMessage() {} // Deprecated: Use Dog.ProtoReflect.Descriptor instead. func (*Dog) Descriptor() ([]byte, []int) { return file_testdata_proto_rawDescGZIP(), []int{0} } func (x *Dog) GetSize() string { if x != nil { return x.Size } return "" } func (x *Dog) GetName() string { if x != nil { return x.Name } return "" } type Cat struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` Lives int32 `protobuf:"varint,2,opt,name=lives,proto3" json:"lives,omitempty"` } func (x *Cat) Reset() { *x = Cat{} if protoimpl.UnsafeEnabled { mi := &file_testdata_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Cat) String() string { return protoimpl.X.MessageStringOf(x) } func (*Cat) ProtoMessage() {} // Deprecated: Use Cat.ProtoReflect.Descriptor instead. func (*Cat) Descriptor() ([]byte, []int) { return file_testdata_proto_rawDescGZIP(), []int{1} } func (x *Cat) GetMoniker() string { if x != nil { return x.Moniker } return "" } func (x *Cat) GetLives() int32 { if x != nil { return x.Lives } return 0 } type HasAnimal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Animal *anypb.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` } func (x *HasAnimal) Reset() { *x = HasAnimal{} if protoimpl.UnsafeEnabled { mi := &file_testdata_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *HasAnimal) String() string { return protoimpl.X.MessageStringOf(x) } func (*HasAnimal) ProtoMessage() {} // Deprecated: Use HasAnimal.ProtoReflect.Descriptor instead. func (*HasAnimal) Descriptor() ([]byte, []int) { return file_testdata_proto_rawDescGZIP(), []int{2} } func (x *HasAnimal) GetAnimal() *anypb.Any { if x != nil { return x.Animal } return nil } func (x *HasAnimal) GetX() int64 { if x != nil { return x.X } return 0 } type HasHasAnimal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields HasAnimal *anypb.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` } func (x *HasHasAnimal) Reset() { *x = HasHasAnimal{} if protoimpl.UnsafeEnabled { mi := &file_testdata_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *HasHasAnimal) String() string { return protoimpl.X.MessageStringOf(x) } func (*HasHasAnimal) ProtoMessage() {} // Deprecated: Use HasHasAnimal.ProtoReflect.Descriptor instead. func (*HasHasAnimal) Descriptor() ([]byte, []int) { return file_testdata_proto_rawDescGZIP(), []int{3} } func (x *HasHasAnimal) GetHasAnimal() *anypb.Any { if x != nil { return x.HasAnimal } return nil } type HasHasHasAnimal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields HasHasAnimal *anypb.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` } func (x *HasHasHasAnimal) Reset() { *x = HasHasHasAnimal{} if protoimpl.UnsafeEnabled { mi := &file_testdata_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *HasHasHasAnimal) String() string { return protoimpl.X.MessageStringOf(x) } func (*HasHasHasAnimal) ProtoMessage() {} // Deprecated: Use HasHasHasAnimal.ProtoReflect.Descriptor instead. func (*HasHasHasAnimal) Descriptor() ([]byte, []int) { return file_testdata_proto_rawDescGZIP(), []int{4} } func (x *HasHasHasAnimal) GetHasHasAnimal() *anypb.Any { if x != nil { return x.HasHasAnimal } return nil } // bad MultiSignature with extra fields type BadMultiSignature struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` MaliciousField []byte `protobuf:"bytes,5,opt,name=malicious_field,json=maliciousField,proto3" json:"malicious_field,omitempty"` } func (x *BadMultiSignature) Reset() { *x = BadMultiSignature{} if protoimpl.UnsafeEnabled { mi := &file_testdata_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BadMultiSignature) String() string { return protoimpl.X.MessageStringOf(x) } func (*BadMultiSignature) ProtoMessage() {} // Deprecated: Use BadMultiSignature.ProtoReflect.Descriptor instead. func (*BadMultiSignature) Descriptor() ([]byte, []int) { return file_testdata_proto_rawDescGZIP(), []int{5} } func (x *BadMultiSignature) GetSignatures() [][]byte { if x != nil { return x.Signatures } return nil } func (x *BadMultiSignature) GetMaliciousField() []byte { if x != nil { return x.MaliciousField } return nil } type TableModel struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Number uint64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *TableModel) Reset() { *x = TableModel{} if protoimpl.UnsafeEnabled { mi := &file_testdata_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *TableModel) String() string { return protoimpl.X.MessageStringOf(x) } func (*TableModel) ProtoMessage() {} // Deprecated: Use TableModel.ProtoReflect.Descriptor instead. func (*TableModel) Descriptor() ([]byte, []int) { return file_testdata_proto_rawDescGZIP(), []int{6} } func (x *TableModel) GetId() uint64 { if x != nil { return x.Id } return 0 } func (x *TableModel) GetName() string { if x != nil { return x.Name } return "" } func (x *TableModel) GetNumber() uint64 { if x != nil { return x.Number } return 0 } func (x *TableModel) GetMetadata() []byte { if x != nil { return x.Metadata } return nil } var File_testdata_proto protoreflect.FileDescriptor var file_testdata_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2d, 0x0a, 0x03, 0x44, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x03, 0x43, 0x61, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x76, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x76, 0x65, 0x73, 0x22, 0x47, 0x0a, 0x09, 0x48, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x01, 0x78, 0x22, 0x43, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x48, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x33, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x68, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x22, 0x4d, 0x0a, 0x0f, 0x48, 0x61, 0x73, 0x48, 0x61, 0x73, 0x48, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x3a, 0x0a, 0x0e, 0x68, 0x61, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0c, 0x68, 0x61, 0x73, 0x48, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x22, 0x62, 0x0a, 0x11, 0x42, 0x61, 0x64, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x6c, 0x69, 0x63, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6d, 0x61, 0x6c, 0x69, 0x63, 0x69, 0x6f, 0x75, 0x73, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x04, 0xd0, 0xa1, 0x1f, 0x01, 0x22, 0x64, 0x0a, 0x0a, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x94, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x42, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x75, 0x6c, 0x73, 0x61, 0x72, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0xca, 0x02, 0x08, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0xe2, 0x02, 0x14, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_testdata_proto_rawDescOnce sync.Once file_testdata_proto_rawDescData = file_testdata_proto_rawDesc ) func file_testdata_proto_rawDescGZIP() []byte { file_testdata_proto_rawDescOnce.Do(func() { file_testdata_proto_rawDescData = protoimpl.X.CompressGZIP(file_testdata_proto_rawDescData) }) return file_testdata_proto_rawDescData } var file_testdata_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_testdata_proto_goTypes = []interface{}{ (*Dog)(nil), // 0: testdata.Dog (*Cat)(nil), // 1: testdata.Cat (*HasAnimal)(nil), // 2: testdata.HasAnimal (*HasHasAnimal)(nil), // 3: testdata.HasHasAnimal (*HasHasHasAnimal)(nil), // 4: testdata.HasHasHasAnimal (*BadMultiSignature)(nil), // 5: testdata.BadMultiSignature (*TableModel)(nil), // 6: testdata.TableModel (*anypb.Any)(nil), // 7: google.protobuf.Any } var file_testdata_proto_depIdxs = []int32{ 7, // 0: testdata.HasAnimal.animal:type_name -> google.protobuf.Any 7, // 1: testdata.HasHasAnimal.has_animal:type_name -> google.protobuf.Any 7, // 2: testdata.HasHasHasAnimal.has_has_animal:type_name -> google.protobuf.Any 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name } func init() { file_testdata_proto_init() } func file_testdata_proto_init() { if File_testdata_proto != nil { return } if !protoimpl.UnsafeEnabled { file_testdata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Dog); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_testdata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Cat); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_testdata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HasAnimal); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_testdata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HasHasAnimal); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_testdata_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HasHasHasAnimal); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_testdata_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BadMultiSignature); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_testdata_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TableModel); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_testdata_proto_rawDesc, NumEnums: 0, NumMessages: 7, NumExtensions: 0, NumServices: 0, }, GoTypes: file_testdata_proto_goTypes, DependencyIndexes: file_testdata_proto_depIdxs, MessageInfos: file_testdata_proto_msgTypes, }.Build() File_testdata_proto = out.File file_testdata_proto_rawDesc = nil file_testdata_proto_goTypes = nil file_testdata_proto_depIdxs = nil }