github.com/cosmos/cosmos-sdk@v0.50.10/testutil/testdata/testpb/testdata.pulsar.go (about) 1 // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. 2 package testpb 3 4 import ( 5 fmt "fmt" 6 runtime "github.com/cosmos/cosmos-proto/runtime" 7 _ "github.com/cosmos/gogoproto/gogoproto" 8 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 9 protoiface "google.golang.org/protobuf/runtime/protoiface" 10 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 11 anypb "google.golang.org/protobuf/types/known/anypb" 12 io "io" 13 reflect "reflect" 14 sync "sync" 15 ) 16 17 var ( 18 md_Dog protoreflect.MessageDescriptor 19 fd_Dog_size protoreflect.FieldDescriptor 20 fd_Dog_name protoreflect.FieldDescriptor 21 ) 22 23 func init() { 24 file_testpb_testdata_proto_init() 25 md_Dog = File_testpb_testdata_proto.Messages().ByName("Dog") 26 fd_Dog_size = md_Dog.Fields().ByName("size") 27 fd_Dog_name = md_Dog.Fields().ByName("name") 28 } 29 30 var _ protoreflect.Message = (*fastReflection_Dog)(nil) 31 32 type fastReflection_Dog Dog 33 34 func (x *Dog) ProtoReflect() protoreflect.Message { 35 return (*fastReflection_Dog)(x) 36 } 37 38 func (x *Dog) slowProtoReflect() protoreflect.Message { 39 mi := &file_testpb_testdata_proto_msgTypes[0] 40 if protoimpl.UnsafeEnabled && x != nil { 41 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 42 if ms.LoadMessageInfo() == nil { 43 ms.StoreMessageInfo(mi) 44 } 45 return ms 46 } 47 return mi.MessageOf(x) 48 } 49 50 var _fastReflection_Dog_messageType fastReflection_Dog_messageType 51 var _ protoreflect.MessageType = fastReflection_Dog_messageType{} 52 53 type fastReflection_Dog_messageType struct{} 54 55 func (x fastReflection_Dog_messageType) Zero() protoreflect.Message { 56 return (*fastReflection_Dog)(nil) 57 } 58 func (x fastReflection_Dog_messageType) New() protoreflect.Message { 59 return new(fastReflection_Dog) 60 } 61 func (x fastReflection_Dog_messageType) Descriptor() protoreflect.MessageDescriptor { 62 return md_Dog 63 } 64 65 // Descriptor returns message descriptor, which contains only the protobuf 66 // type information for the message. 67 func (x *fastReflection_Dog) Descriptor() protoreflect.MessageDescriptor { 68 return md_Dog 69 } 70 71 // Type returns the message type, which encapsulates both Go and protobuf 72 // type information. If the Go type information is not needed, 73 // it is recommended that the message descriptor be used instead. 74 func (x *fastReflection_Dog) Type() protoreflect.MessageType { 75 return _fastReflection_Dog_messageType 76 } 77 78 // New returns a newly allocated and mutable empty message. 79 func (x *fastReflection_Dog) New() protoreflect.Message { 80 return new(fastReflection_Dog) 81 } 82 83 // Interface unwraps the message reflection interface and 84 // returns the underlying ProtoMessage interface. 85 func (x *fastReflection_Dog) Interface() protoreflect.ProtoMessage { 86 return (*Dog)(x) 87 } 88 89 // Range iterates over every populated field in an undefined order, 90 // calling f for each field descriptor and value encountered. 91 // Range returns immediately if f returns false. 92 // While iterating, mutating operations may only be performed 93 // on the current field descriptor. 94 func (x *fastReflection_Dog) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 95 if x.Size != "" { 96 value := protoreflect.ValueOfString(x.Size) 97 if !f(fd_Dog_size, value) { 98 return 99 } 100 } 101 if x.Name != "" { 102 value := protoreflect.ValueOfString(x.Name) 103 if !f(fd_Dog_name, value) { 104 return 105 } 106 } 107 } 108 109 // Has reports whether a field is populated. 110 // 111 // Some fields have the property of nullability where it is possible to 112 // distinguish between the default value of a field and whether the field 113 // was explicitly populated with the default value. Singular message fields, 114 // member fields of a oneof, and proto2 scalar fields are nullable. Such 115 // fields are populated only if explicitly set. 116 // 117 // In other cases (aside from the nullable cases above), 118 // a proto3 scalar field is populated if it contains a non-zero value, and 119 // a repeated field is populated if it is non-empty. 120 func (x *fastReflection_Dog) Has(fd protoreflect.FieldDescriptor) bool { 121 switch fd.FullName() { 122 case "testpb.Dog.size": 123 return x.Size != "" 124 case "testpb.Dog.name": 125 return x.Name != "" 126 default: 127 if fd.IsExtension() { 128 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Dog")) 129 } 130 panic(fmt.Errorf("message testpb.Dog does not contain field %s", fd.FullName())) 131 } 132 } 133 134 // Clear clears the field such that a subsequent Has call reports false. 135 // 136 // Clearing an extension field clears both the extension type and value 137 // associated with the given field number. 138 // 139 // Clear is a mutating operation and unsafe for concurrent use. 140 func (x *fastReflection_Dog) Clear(fd protoreflect.FieldDescriptor) { 141 switch fd.FullName() { 142 case "testpb.Dog.size": 143 x.Size = "" 144 case "testpb.Dog.name": 145 x.Name = "" 146 default: 147 if fd.IsExtension() { 148 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Dog")) 149 } 150 panic(fmt.Errorf("message testpb.Dog does not contain field %s", fd.FullName())) 151 } 152 } 153 154 // Get retrieves the value for a field. 155 // 156 // For unpopulated scalars, it returns the default value, where 157 // the default value of a bytes scalar is guaranteed to be a copy. 158 // For unpopulated composite types, it returns an empty, read-only view 159 // of the value; to obtain a mutable reference, use Mutable. 160 func (x *fastReflection_Dog) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 161 switch descriptor.FullName() { 162 case "testpb.Dog.size": 163 value := x.Size 164 return protoreflect.ValueOfString(value) 165 case "testpb.Dog.name": 166 value := x.Name 167 return protoreflect.ValueOfString(value) 168 default: 169 if descriptor.IsExtension() { 170 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Dog")) 171 } 172 panic(fmt.Errorf("message testpb.Dog does not contain field %s", descriptor.FullName())) 173 } 174 } 175 176 // Set stores the value for a field. 177 // 178 // For a field belonging to a oneof, it implicitly clears any other field 179 // that may be currently set within the same oneof. 180 // For extension fields, it implicitly stores the provided ExtensionType. 181 // When setting a composite type, it is unspecified whether the stored value 182 // aliases the source's memory in any way. If the composite value is an 183 // empty, read-only value, then it panics. 184 // 185 // Set is a mutating operation and unsafe for concurrent use. 186 func (x *fastReflection_Dog) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 187 switch fd.FullName() { 188 case "testpb.Dog.size": 189 x.Size = value.Interface().(string) 190 case "testpb.Dog.name": 191 x.Name = value.Interface().(string) 192 default: 193 if fd.IsExtension() { 194 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Dog")) 195 } 196 panic(fmt.Errorf("message testpb.Dog does not contain field %s", fd.FullName())) 197 } 198 } 199 200 // Mutable returns a mutable reference to a composite type. 201 // 202 // If the field is unpopulated, it may allocate a composite value. 203 // For a field belonging to a oneof, it implicitly clears any other field 204 // that may be currently set within the same oneof. 205 // For extension fields, it implicitly stores the provided ExtensionType 206 // if not already stored. 207 // It panics if the field does not contain a composite type. 208 // 209 // Mutable is a mutating operation and unsafe for concurrent use. 210 func (x *fastReflection_Dog) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 211 switch fd.FullName() { 212 case "testpb.Dog.size": 213 panic(fmt.Errorf("field size of message testpb.Dog is not mutable")) 214 case "testpb.Dog.name": 215 panic(fmt.Errorf("field name of message testpb.Dog is not mutable")) 216 default: 217 if fd.IsExtension() { 218 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Dog")) 219 } 220 panic(fmt.Errorf("message testpb.Dog does not contain field %s", fd.FullName())) 221 } 222 } 223 224 // NewField returns a new value that is assignable to the field 225 // for the given descriptor. For scalars, this returns the default value. 226 // For lists, maps, and messages, this returns a new, empty, mutable value. 227 func (x *fastReflection_Dog) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 228 switch fd.FullName() { 229 case "testpb.Dog.size": 230 return protoreflect.ValueOfString("") 231 case "testpb.Dog.name": 232 return protoreflect.ValueOfString("") 233 default: 234 if fd.IsExtension() { 235 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Dog")) 236 } 237 panic(fmt.Errorf("message testpb.Dog does not contain field %s", fd.FullName())) 238 } 239 } 240 241 // WhichOneof reports which field within the oneof is populated, 242 // returning nil if none are populated. 243 // It panics if the oneof descriptor does not belong to this message. 244 func (x *fastReflection_Dog) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 245 switch d.FullName() { 246 default: 247 panic(fmt.Errorf("%s is not a oneof field in testpb.Dog", d.FullName())) 248 } 249 panic("unreachable") 250 } 251 252 // GetUnknown retrieves the entire list of unknown fields. 253 // The caller may only mutate the contents of the RawFields 254 // if the mutated bytes are stored back into the message with SetUnknown. 255 func (x *fastReflection_Dog) GetUnknown() protoreflect.RawFields { 256 return x.unknownFields 257 } 258 259 // SetUnknown stores an entire list of unknown fields. 260 // The raw fields must be syntactically valid according to the wire format. 261 // An implementation may panic if this is not the case. 262 // Once stored, the caller must not mutate the content of the RawFields. 263 // An empty RawFields may be passed to clear the fields. 264 // 265 // SetUnknown is a mutating operation and unsafe for concurrent use. 266 func (x *fastReflection_Dog) SetUnknown(fields protoreflect.RawFields) { 267 x.unknownFields = fields 268 } 269 270 // IsValid reports whether the message is valid. 271 // 272 // An invalid message is an empty, read-only value. 273 // 274 // An invalid message often corresponds to a nil pointer of the concrete 275 // message type, but the details are implementation dependent. 276 // Validity is not part of the protobuf data model, and may not 277 // be preserved in marshaling or other operations. 278 func (x *fastReflection_Dog) IsValid() bool { 279 return x != nil 280 } 281 282 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 283 // This method may return nil. 284 // 285 // The returned methods type is identical to 286 // "google.golang.org/protobuf/runtime/protoiface".Methods. 287 // Consult the protoiface package documentation for details. 288 func (x *fastReflection_Dog) ProtoMethods() *protoiface.Methods { 289 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 290 x := input.Message.Interface().(*Dog) 291 if x == nil { 292 return protoiface.SizeOutput{ 293 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 294 Size: 0, 295 } 296 } 297 options := runtime.SizeInputToOptions(input) 298 _ = options 299 var n int 300 var l int 301 _ = l 302 l = len(x.Size) 303 if l > 0 { 304 n += 1 + l + runtime.Sov(uint64(l)) 305 } 306 l = len(x.Name) 307 if l > 0 { 308 n += 1 + l + runtime.Sov(uint64(l)) 309 } 310 if x.unknownFields != nil { 311 n += len(x.unknownFields) 312 } 313 return protoiface.SizeOutput{ 314 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 315 Size: n, 316 } 317 } 318 319 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 320 x := input.Message.Interface().(*Dog) 321 if x == nil { 322 return protoiface.MarshalOutput{ 323 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 324 Buf: input.Buf, 325 }, nil 326 } 327 options := runtime.MarshalInputToOptions(input) 328 _ = options 329 size := options.Size(x) 330 dAtA := make([]byte, size) 331 i := len(dAtA) 332 _ = i 333 var l int 334 _ = l 335 if x.unknownFields != nil { 336 i -= len(x.unknownFields) 337 copy(dAtA[i:], x.unknownFields) 338 } 339 if len(x.Name) > 0 { 340 i -= len(x.Name) 341 copy(dAtA[i:], x.Name) 342 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) 343 i-- 344 dAtA[i] = 0x12 345 } 346 if len(x.Size) > 0 { 347 i -= len(x.Size) 348 copy(dAtA[i:], x.Size) 349 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Size))) 350 i-- 351 dAtA[i] = 0xa 352 } 353 if input.Buf != nil { 354 input.Buf = append(input.Buf, dAtA...) 355 } else { 356 input.Buf = dAtA 357 } 358 return protoiface.MarshalOutput{ 359 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 360 Buf: input.Buf, 361 }, nil 362 } 363 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 364 x := input.Message.Interface().(*Dog) 365 if x == nil { 366 return protoiface.UnmarshalOutput{ 367 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 368 Flags: input.Flags, 369 }, nil 370 } 371 options := runtime.UnmarshalInputToOptions(input) 372 _ = options 373 dAtA := input.Buf 374 l := len(dAtA) 375 iNdEx := 0 376 for iNdEx < l { 377 preIndex := iNdEx 378 var wire uint64 379 for shift := uint(0); ; shift += 7 { 380 if shift >= 64 { 381 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 382 } 383 if iNdEx >= l { 384 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 385 } 386 b := dAtA[iNdEx] 387 iNdEx++ 388 wire |= uint64(b&0x7F) << shift 389 if b < 0x80 { 390 break 391 } 392 } 393 fieldNum := int32(wire >> 3) 394 wireType := int(wire & 0x7) 395 if wireType == 4 { 396 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Dog: wiretype end group for non-group") 397 } 398 if fieldNum <= 0 { 399 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Dog: illegal tag %d (wire type %d)", fieldNum, wire) 400 } 401 switch fieldNum { 402 case 1: 403 if wireType != 2 { 404 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) 405 } 406 var stringLen uint64 407 for shift := uint(0); ; shift += 7 { 408 if shift >= 64 { 409 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 410 } 411 if iNdEx >= l { 412 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 413 } 414 b := dAtA[iNdEx] 415 iNdEx++ 416 stringLen |= uint64(b&0x7F) << shift 417 if b < 0x80 { 418 break 419 } 420 } 421 intStringLen := int(stringLen) 422 if intStringLen < 0 { 423 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 424 } 425 postIndex := iNdEx + intStringLen 426 if postIndex < 0 { 427 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 428 } 429 if postIndex > l { 430 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 431 } 432 x.Size = string(dAtA[iNdEx:postIndex]) 433 iNdEx = postIndex 434 case 2: 435 if wireType != 2 { 436 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 437 } 438 var stringLen uint64 439 for shift := uint(0); ; shift += 7 { 440 if shift >= 64 { 441 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 442 } 443 if iNdEx >= l { 444 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 445 } 446 b := dAtA[iNdEx] 447 iNdEx++ 448 stringLen |= uint64(b&0x7F) << shift 449 if b < 0x80 { 450 break 451 } 452 } 453 intStringLen := int(stringLen) 454 if intStringLen < 0 { 455 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 456 } 457 postIndex := iNdEx + intStringLen 458 if postIndex < 0 { 459 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 460 } 461 if postIndex > l { 462 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 463 } 464 x.Name = string(dAtA[iNdEx:postIndex]) 465 iNdEx = postIndex 466 default: 467 iNdEx = preIndex 468 skippy, err := runtime.Skip(dAtA[iNdEx:]) 469 if err != nil { 470 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 471 } 472 if (skippy < 0) || (iNdEx+skippy) < 0 { 473 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 474 } 475 if (iNdEx + skippy) > l { 476 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 477 } 478 if !options.DiscardUnknown { 479 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 480 } 481 iNdEx += skippy 482 } 483 } 484 485 if iNdEx > l { 486 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 487 } 488 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 489 } 490 return &protoiface.Methods{ 491 NoUnkeyedLiterals: struct{}{}, 492 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 493 Size: size, 494 Marshal: marshal, 495 Unmarshal: unmarshal, 496 Merge: nil, 497 CheckInitialized: nil, 498 } 499 } 500 501 var ( 502 md_Cat protoreflect.MessageDescriptor 503 fd_Cat_moniker protoreflect.FieldDescriptor 504 fd_Cat_lives protoreflect.FieldDescriptor 505 ) 506 507 func init() { 508 file_testpb_testdata_proto_init() 509 md_Cat = File_testpb_testdata_proto.Messages().ByName("Cat") 510 fd_Cat_moniker = md_Cat.Fields().ByName("moniker") 511 fd_Cat_lives = md_Cat.Fields().ByName("lives") 512 } 513 514 var _ protoreflect.Message = (*fastReflection_Cat)(nil) 515 516 type fastReflection_Cat Cat 517 518 func (x *Cat) ProtoReflect() protoreflect.Message { 519 return (*fastReflection_Cat)(x) 520 } 521 522 func (x *Cat) slowProtoReflect() protoreflect.Message { 523 mi := &file_testpb_testdata_proto_msgTypes[1] 524 if protoimpl.UnsafeEnabled && x != nil { 525 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 526 if ms.LoadMessageInfo() == nil { 527 ms.StoreMessageInfo(mi) 528 } 529 return ms 530 } 531 return mi.MessageOf(x) 532 } 533 534 var _fastReflection_Cat_messageType fastReflection_Cat_messageType 535 var _ protoreflect.MessageType = fastReflection_Cat_messageType{} 536 537 type fastReflection_Cat_messageType struct{} 538 539 func (x fastReflection_Cat_messageType) Zero() protoreflect.Message { 540 return (*fastReflection_Cat)(nil) 541 } 542 func (x fastReflection_Cat_messageType) New() protoreflect.Message { 543 return new(fastReflection_Cat) 544 } 545 func (x fastReflection_Cat_messageType) Descriptor() protoreflect.MessageDescriptor { 546 return md_Cat 547 } 548 549 // Descriptor returns message descriptor, which contains only the protobuf 550 // type information for the message. 551 func (x *fastReflection_Cat) Descriptor() protoreflect.MessageDescriptor { 552 return md_Cat 553 } 554 555 // Type returns the message type, which encapsulates both Go and protobuf 556 // type information. If the Go type information is not needed, 557 // it is recommended that the message descriptor be used instead. 558 func (x *fastReflection_Cat) Type() protoreflect.MessageType { 559 return _fastReflection_Cat_messageType 560 } 561 562 // New returns a newly allocated and mutable empty message. 563 func (x *fastReflection_Cat) New() protoreflect.Message { 564 return new(fastReflection_Cat) 565 } 566 567 // Interface unwraps the message reflection interface and 568 // returns the underlying ProtoMessage interface. 569 func (x *fastReflection_Cat) Interface() protoreflect.ProtoMessage { 570 return (*Cat)(x) 571 } 572 573 // Range iterates over every populated field in an undefined order, 574 // calling f for each field descriptor and value encountered. 575 // Range returns immediately if f returns false. 576 // While iterating, mutating operations may only be performed 577 // on the current field descriptor. 578 func (x *fastReflection_Cat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 579 if x.Moniker != "" { 580 value := protoreflect.ValueOfString(x.Moniker) 581 if !f(fd_Cat_moniker, value) { 582 return 583 } 584 } 585 if x.Lives != int32(0) { 586 value := protoreflect.ValueOfInt32(x.Lives) 587 if !f(fd_Cat_lives, value) { 588 return 589 } 590 } 591 } 592 593 // Has reports whether a field is populated. 594 // 595 // Some fields have the property of nullability where it is possible to 596 // distinguish between the default value of a field and whether the field 597 // was explicitly populated with the default value. Singular message fields, 598 // member fields of a oneof, and proto2 scalar fields are nullable. Such 599 // fields are populated only if explicitly set. 600 // 601 // In other cases (aside from the nullable cases above), 602 // a proto3 scalar field is populated if it contains a non-zero value, and 603 // a repeated field is populated if it is non-empty. 604 func (x *fastReflection_Cat) Has(fd protoreflect.FieldDescriptor) bool { 605 switch fd.FullName() { 606 case "testpb.Cat.moniker": 607 return x.Moniker != "" 608 case "testpb.Cat.lives": 609 return x.Lives != int32(0) 610 default: 611 if fd.IsExtension() { 612 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Cat")) 613 } 614 panic(fmt.Errorf("message testpb.Cat does not contain field %s", fd.FullName())) 615 } 616 } 617 618 // Clear clears the field such that a subsequent Has call reports false. 619 // 620 // Clearing an extension field clears both the extension type and value 621 // associated with the given field number. 622 // 623 // Clear is a mutating operation and unsafe for concurrent use. 624 func (x *fastReflection_Cat) Clear(fd protoreflect.FieldDescriptor) { 625 switch fd.FullName() { 626 case "testpb.Cat.moniker": 627 x.Moniker = "" 628 case "testpb.Cat.lives": 629 x.Lives = int32(0) 630 default: 631 if fd.IsExtension() { 632 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Cat")) 633 } 634 panic(fmt.Errorf("message testpb.Cat does not contain field %s", fd.FullName())) 635 } 636 } 637 638 // Get retrieves the value for a field. 639 // 640 // For unpopulated scalars, it returns the default value, where 641 // the default value of a bytes scalar is guaranteed to be a copy. 642 // For unpopulated composite types, it returns an empty, read-only view 643 // of the value; to obtain a mutable reference, use Mutable. 644 func (x *fastReflection_Cat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 645 switch descriptor.FullName() { 646 case "testpb.Cat.moniker": 647 value := x.Moniker 648 return protoreflect.ValueOfString(value) 649 case "testpb.Cat.lives": 650 value := x.Lives 651 return protoreflect.ValueOfInt32(value) 652 default: 653 if descriptor.IsExtension() { 654 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Cat")) 655 } 656 panic(fmt.Errorf("message testpb.Cat does not contain field %s", descriptor.FullName())) 657 } 658 } 659 660 // Set stores the value for a field. 661 // 662 // For a field belonging to a oneof, it implicitly clears any other field 663 // that may be currently set within the same oneof. 664 // For extension fields, it implicitly stores the provided ExtensionType. 665 // When setting a composite type, it is unspecified whether the stored value 666 // aliases the source's memory in any way. If the composite value is an 667 // empty, read-only value, then it panics. 668 // 669 // Set is a mutating operation and unsafe for concurrent use. 670 func (x *fastReflection_Cat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 671 switch fd.FullName() { 672 case "testpb.Cat.moniker": 673 x.Moniker = value.Interface().(string) 674 case "testpb.Cat.lives": 675 x.Lives = int32(value.Int()) 676 default: 677 if fd.IsExtension() { 678 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Cat")) 679 } 680 panic(fmt.Errorf("message testpb.Cat does not contain field %s", fd.FullName())) 681 } 682 } 683 684 // Mutable returns a mutable reference to a composite type. 685 // 686 // If the field is unpopulated, it may allocate a composite value. 687 // For a field belonging to a oneof, it implicitly clears any other field 688 // that may be currently set within the same oneof. 689 // For extension fields, it implicitly stores the provided ExtensionType 690 // if not already stored. 691 // It panics if the field does not contain a composite type. 692 // 693 // Mutable is a mutating operation and unsafe for concurrent use. 694 func (x *fastReflection_Cat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 695 switch fd.FullName() { 696 case "testpb.Cat.moniker": 697 panic(fmt.Errorf("field moniker of message testpb.Cat is not mutable")) 698 case "testpb.Cat.lives": 699 panic(fmt.Errorf("field lives of message testpb.Cat is not mutable")) 700 default: 701 if fd.IsExtension() { 702 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Cat")) 703 } 704 panic(fmt.Errorf("message testpb.Cat does not contain field %s", fd.FullName())) 705 } 706 } 707 708 // NewField returns a new value that is assignable to the field 709 // for the given descriptor. For scalars, this returns the default value. 710 // For lists, maps, and messages, this returns a new, empty, mutable value. 711 func (x *fastReflection_Cat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 712 switch fd.FullName() { 713 case "testpb.Cat.moniker": 714 return protoreflect.ValueOfString("") 715 case "testpb.Cat.lives": 716 return protoreflect.ValueOfInt32(int32(0)) 717 default: 718 if fd.IsExtension() { 719 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Cat")) 720 } 721 panic(fmt.Errorf("message testpb.Cat does not contain field %s", fd.FullName())) 722 } 723 } 724 725 // WhichOneof reports which field within the oneof is populated, 726 // returning nil if none are populated. 727 // It panics if the oneof descriptor does not belong to this message. 728 func (x *fastReflection_Cat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 729 switch d.FullName() { 730 default: 731 panic(fmt.Errorf("%s is not a oneof field in testpb.Cat", d.FullName())) 732 } 733 panic("unreachable") 734 } 735 736 // GetUnknown retrieves the entire list of unknown fields. 737 // The caller may only mutate the contents of the RawFields 738 // if the mutated bytes are stored back into the message with SetUnknown. 739 func (x *fastReflection_Cat) GetUnknown() protoreflect.RawFields { 740 return x.unknownFields 741 } 742 743 // SetUnknown stores an entire list of unknown fields. 744 // The raw fields must be syntactically valid according to the wire format. 745 // An implementation may panic if this is not the case. 746 // Once stored, the caller must not mutate the content of the RawFields. 747 // An empty RawFields may be passed to clear the fields. 748 // 749 // SetUnknown is a mutating operation and unsafe for concurrent use. 750 func (x *fastReflection_Cat) SetUnknown(fields protoreflect.RawFields) { 751 x.unknownFields = fields 752 } 753 754 // IsValid reports whether the message is valid. 755 // 756 // An invalid message is an empty, read-only value. 757 // 758 // An invalid message often corresponds to a nil pointer of the concrete 759 // message type, but the details are implementation dependent. 760 // Validity is not part of the protobuf data model, and may not 761 // be preserved in marshaling or other operations. 762 func (x *fastReflection_Cat) IsValid() bool { 763 return x != nil 764 } 765 766 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 767 // This method may return nil. 768 // 769 // The returned methods type is identical to 770 // "google.golang.org/protobuf/runtime/protoiface".Methods. 771 // Consult the protoiface package documentation for details. 772 func (x *fastReflection_Cat) ProtoMethods() *protoiface.Methods { 773 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 774 x := input.Message.Interface().(*Cat) 775 if x == nil { 776 return protoiface.SizeOutput{ 777 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 778 Size: 0, 779 } 780 } 781 options := runtime.SizeInputToOptions(input) 782 _ = options 783 var n int 784 var l int 785 _ = l 786 l = len(x.Moniker) 787 if l > 0 { 788 n += 1 + l + runtime.Sov(uint64(l)) 789 } 790 if x.Lives != 0 { 791 n += 1 + runtime.Sov(uint64(x.Lives)) 792 } 793 if x.unknownFields != nil { 794 n += len(x.unknownFields) 795 } 796 return protoiface.SizeOutput{ 797 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 798 Size: n, 799 } 800 } 801 802 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 803 x := input.Message.Interface().(*Cat) 804 if x == nil { 805 return protoiface.MarshalOutput{ 806 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 807 Buf: input.Buf, 808 }, nil 809 } 810 options := runtime.MarshalInputToOptions(input) 811 _ = options 812 size := options.Size(x) 813 dAtA := make([]byte, size) 814 i := len(dAtA) 815 _ = i 816 var l int 817 _ = l 818 if x.unknownFields != nil { 819 i -= len(x.unknownFields) 820 copy(dAtA[i:], x.unknownFields) 821 } 822 if x.Lives != 0 { 823 i = runtime.EncodeVarint(dAtA, i, uint64(x.Lives)) 824 i-- 825 dAtA[i] = 0x10 826 } 827 if len(x.Moniker) > 0 { 828 i -= len(x.Moniker) 829 copy(dAtA[i:], x.Moniker) 830 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Moniker))) 831 i-- 832 dAtA[i] = 0xa 833 } 834 if input.Buf != nil { 835 input.Buf = append(input.Buf, dAtA...) 836 } else { 837 input.Buf = dAtA 838 } 839 return protoiface.MarshalOutput{ 840 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 841 Buf: input.Buf, 842 }, nil 843 } 844 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 845 x := input.Message.Interface().(*Cat) 846 if x == nil { 847 return protoiface.UnmarshalOutput{ 848 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 849 Flags: input.Flags, 850 }, nil 851 } 852 options := runtime.UnmarshalInputToOptions(input) 853 _ = options 854 dAtA := input.Buf 855 l := len(dAtA) 856 iNdEx := 0 857 for iNdEx < l { 858 preIndex := iNdEx 859 var wire uint64 860 for shift := uint(0); ; shift += 7 { 861 if shift >= 64 { 862 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 863 } 864 if iNdEx >= l { 865 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 866 } 867 b := dAtA[iNdEx] 868 iNdEx++ 869 wire |= uint64(b&0x7F) << shift 870 if b < 0x80 { 871 break 872 } 873 } 874 fieldNum := int32(wire >> 3) 875 wireType := int(wire & 0x7) 876 if wireType == 4 { 877 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Cat: wiretype end group for non-group") 878 } 879 if fieldNum <= 0 { 880 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Cat: illegal tag %d (wire type %d)", fieldNum, wire) 881 } 882 switch fieldNum { 883 case 1: 884 if wireType != 2 { 885 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) 886 } 887 var stringLen uint64 888 for shift := uint(0); ; shift += 7 { 889 if shift >= 64 { 890 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 891 } 892 if iNdEx >= l { 893 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 894 } 895 b := dAtA[iNdEx] 896 iNdEx++ 897 stringLen |= uint64(b&0x7F) << shift 898 if b < 0x80 { 899 break 900 } 901 } 902 intStringLen := int(stringLen) 903 if intStringLen < 0 { 904 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 905 } 906 postIndex := iNdEx + intStringLen 907 if postIndex < 0 { 908 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 909 } 910 if postIndex > l { 911 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 912 } 913 x.Moniker = string(dAtA[iNdEx:postIndex]) 914 iNdEx = postIndex 915 case 2: 916 if wireType != 0 { 917 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Lives", wireType) 918 } 919 x.Lives = 0 920 for shift := uint(0); ; shift += 7 { 921 if shift >= 64 { 922 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 923 } 924 if iNdEx >= l { 925 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 926 } 927 b := dAtA[iNdEx] 928 iNdEx++ 929 x.Lives |= int32(b&0x7F) << shift 930 if b < 0x80 { 931 break 932 } 933 } 934 default: 935 iNdEx = preIndex 936 skippy, err := runtime.Skip(dAtA[iNdEx:]) 937 if err != nil { 938 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 939 } 940 if (skippy < 0) || (iNdEx+skippy) < 0 { 941 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 942 } 943 if (iNdEx + skippy) > l { 944 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 945 } 946 if !options.DiscardUnknown { 947 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 948 } 949 iNdEx += skippy 950 } 951 } 952 953 if iNdEx > l { 954 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 955 } 956 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 957 } 958 return &protoiface.Methods{ 959 NoUnkeyedLiterals: struct{}{}, 960 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 961 Size: size, 962 Marshal: marshal, 963 Unmarshal: unmarshal, 964 Merge: nil, 965 CheckInitialized: nil, 966 } 967 } 968 969 var ( 970 md_Bird protoreflect.MessageDescriptor 971 fd_Bird_species protoreflect.FieldDescriptor 972 fd_Bird_color protoreflect.FieldDescriptor 973 ) 974 975 func init() { 976 file_testpb_testdata_proto_init() 977 md_Bird = File_testpb_testdata_proto.Messages().ByName("Bird") 978 fd_Bird_species = md_Bird.Fields().ByName("species") 979 fd_Bird_color = md_Bird.Fields().ByName("color") 980 } 981 982 var _ protoreflect.Message = (*fastReflection_Bird)(nil) 983 984 type fastReflection_Bird Bird 985 986 func (x *Bird) ProtoReflect() protoreflect.Message { 987 return (*fastReflection_Bird)(x) 988 } 989 990 func (x *Bird) slowProtoReflect() protoreflect.Message { 991 mi := &file_testpb_testdata_proto_msgTypes[2] 992 if protoimpl.UnsafeEnabled && x != nil { 993 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 994 if ms.LoadMessageInfo() == nil { 995 ms.StoreMessageInfo(mi) 996 } 997 return ms 998 } 999 return mi.MessageOf(x) 1000 } 1001 1002 var _fastReflection_Bird_messageType fastReflection_Bird_messageType 1003 var _ protoreflect.MessageType = fastReflection_Bird_messageType{} 1004 1005 type fastReflection_Bird_messageType struct{} 1006 1007 func (x fastReflection_Bird_messageType) Zero() protoreflect.Message { 1008 return (*fastReflection_Bird)(nil) 1009 } 1010 func (x fastReflection_Bird_messageType) New() protoreflect.Message { 1011 return new(fastReflection_Bird) 1012 } 1013 func (x fastReflection_Bird_messageType) Descriptor() protoreflect.MessageDescriptor { 1014 return md_Bird 1015 } 1016 1017 // Descriptor returns message descriptor, which contains only the protobuf 1018 // type information for the message. 1019 func (x *fastReflection_Bird) Descriptor() protoreflect.MessageDescriptor { 1020 return md_Bird 1021 } 1022 1023 // Type returns the message type, which encapsulates both Go and protobuf 1024 // type information. If the Go type information is not needed, 1025 // it is recommended that the message descriptor be used instead. 1026 func (x *fastReflection_Bird) Type() protoreflect.MessageType { 1027 return _fastReflection_Bird_messageType 1028 } 1029 1030 // New returns a newly allocated and mutable empty message. 1031 func (x *fastReflection_Bird) New() protoreflect.Message { 1032 return new(fastReflection_Bird) 1033 } 1034 1035 // Interface unwraps the message reflection interface and 1036 // returns the underlying ProtoMessage interface. 1037 func (x *fastReflection_Bird) Interface() protoreflect.ProtoMessage { 1038 return (*Bird)(x) 1039 } 1040 1041 // Range iterates over every populated field in an undefined order, 1042 // calling f for each field descriptor and value encountered. 1043 // Range returns immediately if f returns false. 1044 // While iterating, mutating operations may only be performed 1045 // on the current field descriptor. 1046 func (x *fastReflection_Bird) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 1047 if x.Species != "" { 1048 value := protoreflect.ValueOfString(x.Species) 1049 if !f(fd_Bird_species, value) { 1050 return 1051 } 1052 } 1053 if x.Color != int32(0) { 1054 value := protoreflect.ValueOfInt32(x.Color) 1055 if !f(fd_Bird_color, value) { 1056 return 1057 } 1058 } 1059 } 1060 1061 // Has reports whether a field is populated. 1062 // 1063 // Some fields have the property of nullability where it is possible to 1064 // distinguish between the default value of a field and whether the field 1065 // was explicitly populated with the default value. Singular message fields, 1066 // member fields of a oneof, and proto2 scalar fields are nullable. Such 1067 // fields are populated only if explicitly set. 1068 // 1069 // In other cases (aside from the nullable cases above), 1070 // a proto3 scalar field is populated if it contains a non-zero value, and 1071 // a repeated field is populated if it is non-empty. 1072 func (x *fastReflection_Bird) Has(fd protoreflect.FieldDescriptor) bool { 1073 switch fd.FullName() { 1074 case "testpb.Bird.species": 1075 return x.Species != "" 1076 case "testpb.Bird.color": 1077 return x.Color != int32(0) 1078 default: 1079 if fd.IsExtension() { 1080 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Bird")) 1081 } 1082 panic(fmt.Errorf("message testpb.Bird does not contain field %s", fd.FullName())) 1083 } 1084 } 1085 1086 // Clear clears the field such that a subsequent Has call reports false. 1087 // 1088 // Clearing an extension field clears both the extension type and value 1089 // associated with the given field number. 1090 // 1091 // Clear is a mutating operation and unsafe for concurrent use. 1092 func (x *fastReflection_Bird) Clear(fd protoreflect.FieldDescriptor) { 1093 switch fd.FullName() { 1094 case "testpb.Bird.species": 1095 x.Species = "" 1096 case "testpb.Bird.color": 1097 x.Color = int32(0) 1098 default: 1099 if fd.IsExtension() { 1100 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Bird")) 1101 } 1102 panic(fmt.Errorf("message testpb.Bird does not contain field %s", fd.FullName())) 1103 } 1104 } 1105 1106 // Get retrieves the value for a field. 1107 // 1108 // For unpopulated scalars, it returns the default value, where 1109 // the default value of a bytes scalar is guaranteed to be a copy. 1110 // For unpopulated composite types, it returns an empty, read-only view 1111 // of the value; to obtain a mutable reference, use Mutable. 1112 func (x *fastReflection_Bird) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 1113 switch descriptor.FullName() { 1114 case "testpb.Bird.species": 1115 value := x.Species 1116 return protoreflect.ValueOfString(value) 1117 case "testpb.Bird.color": 1118 value := x.Color 1119 return protoreflect.ValueOfInt32(value) 1120 default: 1121 if descriptor.IsExtension() { 1122 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Bird")) 1123 } 1124 panic(fmt.Errorf("message testpb.Bird does not contain field %s", descriptor.FullName())) 1125 } 1126 } 1127 1128 // Set stores the value for a field. 1129 // 1130 // For a field belonging to a oneof, it implicitly clears any other field 1131 // that may be currently set within the same oneof. 1132 // For extension fields, it implicitly stores the provided ExtensionType. 1133 // When setting a composite type, it is unspecified whether the stored value 1134 // aliases the source's memory in any way. If the composite value is an 1135 // empty, read-only value, then it panics. 1136 // 1137 // Set is a mutating operation and unsafe for concurrent use. 1138 func (x *fastReflection_Bird) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 1139 switch fd.FullName() { 1140 case "testpb.Bird.species": 1141 x.Species = value.Interface().(string) 1142 case "testpb.Bird.color": 1143 x.Color = int32(value.Int()) 1144 default: 1145 if fd.IsExtension() { 1146 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Bird")) 1147 } 1148 panic(fmt.Errorf("message testpb.Bird does not contain field %s", fd.FullName())) 1149 } 1150 } 1151 1152 // Mutable returns a mutable reference to a composite type. 1153 // 1154 // If the field is unpopulated, it may allocate a composite value. 1155 // For a field belonging to a oneof, it implicitly clears any other field 1156 // that may be currently set within the same oneof. 1157 // For extension fields, it implicitly stores the provided ExtensionType 1158 // if not already stored. 1159 // It panics if the field does not contain a composite type. 1160 // 1161 // Mutable is a mutating operation and unsafe for concurrent use. 1162 func (x *fastReflection_Bird) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 1163 switch fd.FullName() { 1164 case "testpb.Bird.species": 1165 panic(fmt.Errorf("field species of message testpb.Bird is not mutable")) 1166 case "testpb.Bird.color": 1167 panic(fmt.Errorf("field color of message testpb.Bird is not mutable")) 1168 default: 1169 if fd.IsExtension() { 1170 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Bird")) 1171 } 1172 panic(fmt.Errorf("message testpb.Bird does not contain field %s", fd.FullName())) 1173 } 1174 } 1175 1176 // NewField returns a new value that is assignable to the field 1177 // for the given descriptor. For scalars, this returns the default value. 1178 // For lists, maps, and messages, this returns a new, empty, mutable value. 1179 func (x *fastReflection_Bird) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 1180 switch fd.FullName() { 1181 case "testpb.Bird.species": 1182 return protoreflect.ValueOfString("") 1183 case "testpb.Bird.color": 1184 return protoreflect.ValueOfInt32(int32(0)) 1185 default: 1186 if fd.IsExtension() { 1187 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Bird")) 1188 } 1189 panic(fmt.Errorf("message testpb.Bird does not contain field %s", fd.FullName())) 1190 } 1191 } 1192 1193 // WhichOneof reports which field within the oneof is populated, 1194 // returning nil if none are populated. 1195 // It panics if the oneof descriptor does not belong to this message. 1196 func (x *fastReflection_Bird) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 1197 switch d.FullName() { 1198 default: 1199 panic(fmt.Errorf("%s is not a oneof field in testpb.Bird", d.FullName())) 1200 } 1201 panic("unreachable") 1202 } 1203 1204 // GetUnknown retrieves the entire list of unknown fields. 1205 // The caller may only mutate the contents of the RawFields 1206 // if the mutated bytes are stored back into the message with SetUnknown. 1207 func (x *fastReflection_Bird) GetUnknown() protoreflect.RawFields { 1208 return x.unknownFields 1209 } 1210 1211 // SetUnknown stores an entire list of unknown fields. 1212 // The raw fields must be syntactically valid according to the wire format. 1213 // An implementation may panic if this is not the case. 1214 // Once stored, the caller must not mutate the content of the RawFields. 1215 // An empty RawFields may be passed to clear the fields. 1216 // 1217 // SetUnknown is a mutating operation and unsafe for concurrent use. 1218 func (x *fastReflection_Bird) SetUnknown(fields protoreflect.RawFields) { 1219 x.unknownFields = fields 1220 } 1221 1222 // IsValid reports whether the message is valid. 1223 // 1224 // An invalid message is an empty, read-only value. 1225 // 1226 // An invalid message often corresponds to a nil pointer of the concrete 1227 // message type, but the details are implementation dependent. 1228 // Validity is not part of the protobuf data model, and may not 1229 // be preserved in marshaling or other operations. 1230 func (x *fastReflection_Bird) IsValid() bool { 1231 return x != nil 1232 } 1233 1234 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 1235 // This method may return nil. 1236 // 1237 // The returned methods type is identical to 1238 // "google.golang.org/protobuf/runtime/protoiface".Methods. 1239 // Consult the protoiface package documentation for details. 1240 func (x *fastReflection_Bird) ProtoMethods() *protoiface.Methods { 1241 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 1242 x := input.Message.Interface().(*Bird) 1243 if x == nil { 1244 return protoiface.SizeOutput{ 1245 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1246 Size: 0, 1247 } 1248 } 1249 options := runtime.SizeInputToOptions(input) 1250 _ = options 1251 var n int 1252 var l int 1253 _ = l 1254 l = len(x.Species) 1255 if l > 0 { 1256 n += 1 + l + runtime.Sov(uint64(l)) 1257 } 1258 if x.Color != 0 { 1259 n += 1 + runtime.Sov(uint64(x.Color)) 1260 } 1261 if x.unknownFields != nil { 1262 n += len(x.unknownFields) 1263 } 1264 return protoiface.SizeOutput{ 1265 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1266 Size: n, 1267 } 1268 } 1269 1270 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 1271 x := input.Message.Interface().(*Bird) 1272 if x == nil { 1273 return protoiface.MarshalOutput{ 1274 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1275 Buf: input.Buf, 1276 }, nil 1277 } 1278 options := runtime.MarshalInputToOptions(input) 1279 _ = options 1280 size := options.Size(x) 1281 dAtA := make([]byte, size) 1282 i := len(dAtA) 1283 _ = i 1284 var l int 1285 _ = l 1286 if x.unknownFields != nil { 1287 i -= len(x.unknownFields) 1288 copy(dAtA[i:], x.unknownFields) 1289 } 1290 if x.Color != 0 { 1291 i = runtime.EncodeVarint(dAtA, i, uint64(x.Color)) 1292 i-- 1293 dAtA[i] = 0x10 1294 } 1295 if len(x.Species) > 0 { 1296 i -= len(x.Species) 1297 copy(dAtA[i:], x.Species) 1298 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Species))) 1299 i-- 1300 dAtA[i] = 0xa 1301 } 1302 if input.Buf != nil { 1303 input.Buf = append(input.Buf, dAtA...) 1304 } else { 1305 input.Buf = dAtA 1306 } 1307 return protoiface.MarshalOutput{ 1308 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1309 Buf: input.Buf, 1310 }, nil 1311 } 1312 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 1313 x := input.Message.Interface().(*Bird) 1314 if x == nil { 1315 return protoiface.UnmarshalOutput{ 1316 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1317 Flags: input.Flags, 1318 }, nil 1319 } 1320 options := runtime.UnmarshalInputToOptions(input) 1321 _ = options 1322 dAtA := input.Buf 1323 l := len(dAtA) 1324 iNdEx := 0 1325 for iNdEx < l { 1326 preIndex := iNdEx 1327 var wire uint64 1328 for shift := uint(0); ; shift += 7 { 1329 if shift >= 64 { 1330 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 1331 } 1332 if iNdEx >= l { 1333 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1334 } 1335 b := dAtA[iNdEx] 1336 iNdEx++ 1337 wire |= uint64(b&0x7F) << shift 1338 if b < 0x80 { 1339 break 1340 } 1341 } 1342 fieldNum := int32(wire >> 3) 1343 wireType := int(wire & 0x7) 1344 if wireType == 4 { 1345 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Bird: wiretype end group for non-group") 1346 } 1347 if fieldNum <= 0 { 1348 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Bird: illegal tag %d (wire type %d)", fieldNum, wire) 1349 } 1350 switch fieldNum { 1351 case 1: 1352 if wireType != 2 { 1353 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Species", wireType) 1354 } 1355 var stringLen uint64 1356 for shift := uint(0); ; shift += 7 { 1357 if shift >= 64 { 1358 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 1359 } 1360 if iNdEx >= l { 1361 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1362 } 1363 b := dAtA[iNdEx] 1364 iNdEx++ 1365 stringLen |= uint64(b&0x7F) << shift 1366 if b < 0x80 { 1367 break 1368 } 1369 } 1370 intStringLen := int(stringLen) 1371 if intStringLen < 0 { 1372 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 1373 } 1374 postIndex := iNdEx + intStringLen 1375 if postIndex < 0 { 1376 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 1377 } 1378 if postIndex > l { 1379 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1380 } 1381 x.Species = string(dAtA[iNdEx:postIndex]) 1382 iNdEx = postIndex 1383 case 2: 1384 if wireType != 0 { 1385 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Color", wireType) 1386 } 1387 x.Color = 0 1388 for shift := uint(0); ; shift += 7 { 1389 if shift >= 64 { 1390 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 1391 } 1392 if iNdEx >= l { 1393 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1394 } 1395 b := dAtA[iNdEx] 1396 iNdEx++ 1397 x.Color |= int32(b&0x7F) << shift 1398 if b < 0x80 { 1399 break 1400 } 1401 } 1402 default: 1403 iNdEx = preIndex 1404 skippy, err := runtime.Skip(dAtA[iNdEx:]) 1405 if err != nil { 1406 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 1407 } 1408 if (skippy < 0) || (iNdEx+skippy) < 0 { 1409 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 1410 } 1411 if (iNdEx + skippy) > l { 1412 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1413 } 1414 if !options.DiscardUnknown { 1415 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 1416 } 1417 iNdEx += skippy 1418 } 1419 } 1420 1421 if iNdEx > l { 1422 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1423 } 1424 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 1425 } 1426 return &protoiface.Methods{ 1427 NoUnkeyedLiterals: struct{}{}, 1428 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 1429 Size: size, 1430 Marshal: marshal, 1431 Unmarshal: unmarshal, 1432 Merge: nil, 1433 CheckInitialized: nil, 1434 } 1435 } 1436 1437 var ( 1438 md_HasAnimal protoreflect.MessageDescriptor 1439 fd_HasAnimal_animal protoreflect.FieldDescriptor 1440 fd_HasAnimal_x protoreflect.FieldDescriptor 1441 ) 1442 1443 func init() { 1444 file_testpb_testdata_proto_init() 1445 md_HasAnimal = File_testpb_testdata_proto.Messages().ByName("HasAnimal") 1446 fd_HasAnimal_animal = md_HasAnimal.Fields().ByName("animal") 1447 fd_HasAnimal_x = md_HasAnimal.Fields().ByName("x") 1448 } 1449 1450 var _ protoreflect.Message = (*fastReflection_HasAnimal)(nil) 1451 1452 type fastReflection_HasAnimal HasAnimal 1453 1454 func (x *HasAnimal) ProtoReflect() protoreflect.Message { 1455 return (*fastReflection_HasAnimal)(x) 1456 } 1457 1458 func (x *HasAnimal) slowProtoReflect() protoreflect.Message { 1459 mi := &file_testpb_testdata_proto_msgTypes[3] 1460 if protoimpl.UnsafeEnabled && x != nil { 1461 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1462 if ms.LoadMessageInfo() == nil { 1463 ms.StoreMessageInfo(mi) 1464 } 1465 return ms 1466 } 1467 return mi.MessageOf(x) 1468 } 1469 1470 var _fastReflection_HasAnimal_messageType fastReflection_HasAnimal_messageType 1471 var _ protoreflect.MessageType = fastReflection_HasAnimal_messageType{} 1472 1473 type fastReflection_HasAnimal_messageType struct{} 1474 1475 func (x fastReflection_HasAnimal_messageType) Zero() protoreflect.Message { 1476 return (*fastReflection_HasAnimal)(nil) 1477 } 1478 func (x fastReflection_HasAnimal_messageType) New() protoreflect.Message { 1479 return new(fastReflection_HasAnimal) 1480 } 1481 func (x fastReflection_HasAnimal_messageType) Descriptor() protoreflect.MessageDescriptor { 1482 return md_HasAnimal 1483 } 1484 1485 // Descriptor returns message descriptor, which contains only the protobuf 1486 // type information for the message. 1487 func (x *fastReflection_HasAnimal) Descriptor() protoreflect.MessageDescriptor { 1488 return md_HasAnimal 1489 } 1490 1491 // Type returns the message type, which encapsulates both Go and protobuf 1492 // type information. If the Go type information is not needed, 1493 // it is recommended that the message descriptor be used instead. 1494 func (x *fastReflection_HasAnimal) Type() protoreflect.MessageType { 1495 return _fastReflection_HasAnimal_messageType 1496 } 1497 1498 // New returns a newly allocated and mutable empty message. 1499 func (x *fastReflection_HasAnimal) New() protoreflect.Message { 1500 return new(fastReflection_HasAnimal) 1501 } 1502 1503 // Interface unwraps the message reflection interface and 1504 // returns the underlying ProtoMessage interface. 1505 func (x *fastReflection_HasAnimal) Interface() protoreflect.ProtoMessage { 1506 return (*HasAnimal)(x) 1507 } 1508 1509 // Range iterates over every populated field in an undefined order, 1510 // calling f for each field descriptor and value encountered. 1511 // Range returns immediately if f returns false. 1512 // While iterating, mutating operations may only be performed 1513 // on the current field descriptor. 1514 func (x *fastReflection_HasAnimal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 1515 if x.Animal != nil { 1516 value := protoreflect.ValueOfMessage(x.Animal.ProtoReflect()) 1517 if !f(fd_HasAnimal_animal, value) { 1518 return 1519 } 1520 } 1521 if x.X != int64(0) { 1522 value := protoreflect.ValueOfInt64(x.X) 1523 if !f(fd_HasAnimal_x, value) { 1524 return 1525 } 1526 } 1527 } 1528 1529 // Has reports whether a field is populated. 1530 // 1531 // Some fields have the property of nullability where it is possible to 1532 // distinguish between the default value of a field and whether the field 1533 // was explicitly populated with the default value. Singular message fields, 1534 // member fields of a oneof, and proto2 scalar fields are nullable. Such 1535 // fields are populated only if explicitly set. 1536 // 1537 // In other cases (aside from the nullable cases above), 1538 // a proto3 scalar field is populated if it contains a non-zero value, and 1539 // a repeated field is populated if it is non-empty. 1540 func (x *fastReflection_HasAnimal) Has(fd protoreflect.FieldDescriptor) bool { 1541 switch fd.FullName() { 1542 case "testpb.HasAnimal.animal": 1543 return x.Animal != nil 1544 case "testpb.HasAnimal.x": 1545 return x.X != int64(0) 1546 default: 1547 if fd.IsExtension() { 1548 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasAnimal")) 1549 } 1550 panic(fmt.Errorf("message testpb.HasAnimal does not contain field %s", fd.FullName())) 1551 } 1552 } 1553 1554 // Clear clears the field such that a subsequent Has call reports false. 1555 // 1556 // Clearing an extension field clears both the extension type and value 1557 // associated with the given field number. 1558 // 1559 // Clear is a mutating operation and unsafe for concurrent use. 1560 func (x *fastReflection_HasAnimal) Clear(fd protoreflect.FieldDescriptor) { 1561 switch fd.FullName() { 1562 case "testpb.HasAnimal.animal": 1563 x.Animal = nil 1564 case "testpb.HasAnimal.x": 1565 x.X = int64(0) 1566 default: 1567 if fd.IsExtension() { 1568 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasAnimal")) 1569 } 1570 panic(fmt.Errorf("message testpb.HasAnimal does not contain field %s", fd.FullName())) 1571 } 1572 } 1573 1574 // Get retrieves the value for a field. 1575 // 1576 // For unpopulated scalars, it returns the default value, where 1577 // the default value of a bytes scalar is guaranteed to be a copy. 1578 // For unpopulated composite types, it returns an empty, read-only view 1579 // of the value; to obtain a mutable reference, use Mutable. 1580 func (x *fastReflection_HasAnimal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 1581 switch descriptor.FullName() { 1582 case "testpb.HasAnimal.animal": 1583 value := x.Animal 1584 return protoreflect.ValueOfMessage(value.ProtoReflect()) 1585 case "testpb.HasAnimal.x": 1586 value := x.X 1587 return protoreflect.ValueOfInt64(value) 1588 default: 1589 if descriptor.IsExtension() { 1590 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasAnimal")) 1591 } 1592 panic(fmt.Errorf("message testpb.HasAnimal does not contain field %s", descriptor.FullName())) 1593 } 1594 } 1595 1596 // Set stores the value for a field. 1597 // 1598 // For a field belonging to a oneof, it implicitly clears any other field 1599 // that may be currently set within the same oneof. 1600 // For extension fields, it implicitly stores the provided ExtensionType. 1601 // When setting a composite type, it is unspecified whether the stored value 1602 // aliases the source's memory in any way. If the composite value is an 1603 // empty, read-only value, then it panics. 1604 // 1605 // Set is a mutating operation and unsafe for concurrent use. 1606 func (x *fastReflection_HasAnimal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 1607 switch fd.FullName() { 1608 case "testpb.HasAnimal.animal": 1609 x.Animal = value.Message().Interface().(*anypb.Any) 1610 case "testpb.HasAnimal.x": 1611 x.X = value.Int() 1612 default: 1613 if fd.IsExtension() { 1614 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasAnimal")) 1615 } 1616 panic(fmt.Errorf("message testpb.HasAnimal does not contain field %s", fd.FullName())) 1617 } 1618 } 1619 1620 // Mutable returns a mutable reference to a composite type. 1621 // 1622 // If the field is unpopulated, it may allocate a composite value. 1623 // For a field belonging to a oneof, it implicitly clears any other field 1624 // that may be currently set within the same oneof. 1625 // For extension fields, it implicitly stores the provided ExtensionType 1626 // if not already stored. 1627 // It panics if the field does not contain a composite type. 1628 // 1629 // Mutable is a mutating operation and unsafe for concurrent use. 1630 func (x *fastReflection_HasAnimal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 1631 switch fd.FullName() { 1632 case "testpb.HasAnimal.animal": 1633 if x.Animal == nil { 1634 x.Animal = new(anypb.Any) 1635 } 1636 return protoreflect.ValueOfMessage(x.Animal.ProtoReflect()) 1637 case "testpb.HasAnimal.x": 1638 panic(fmt.Errorf("field x of message testpb.HasAnimal is not mutable")) 1639 default: 1640 if fd.IsExtension() { 1641 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasAnimal")) 1642 } 1643 panic(fmt.Errorf("message testpb.HasAnimal does not contain field %s", fd.FullName())) 1644 } 1645 } 1646 1647 // NewField returns a new value that is assignable to the field 1648 // for the given descriptor. For scalars, this returns the default value. 1649 // For lists, maps, and messages, this returns a new, empty, mutable value. 1650 func (x *fastReflection_HasAnimal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 1651 switch fd.FullName() { 1652 case "testpb.HasAnimal.animal": 1653 m := new(anypb.Any) 1654 return protoreflect.ValueOfMessage(m.ProtoReflect()) 1655 case "testpb.HasAnimal.x": 1656 return protoreflect.ValueOfInt64(int64(0)) 1657 default: 1658 if fd.IsExtension() { 1659 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasAnimal")) 1660 } 1661 panic(fmt.Errorf("message testpb.HasAnimal does not contain field %s", fd.FullName())) 1662 } 1663 } 1664 1665 // WhichOneof reports which field within the oneof is populated, 1666 // returning nil if none are populated. 1667 // It panics if the oneof descriptor does not belong to this message. 1668 func (x *fastReflection_HasAnimal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 1669 switch d.FullName() { 1670 default: 1671 panic(fmt.Errorf("%s is not a oneof field in testpb.HasAnimal", d.FullName())) 1672 } 1673 panic("unreachable") 1674 } 1675 1676 // GetUnknown retrieves the entire list of unknown fields. 1677 // The caller may only mutate the contents of the RawFields 1678 // if the mutated bytes are stored back into the message with SetUnknown. 1679 func (x *fastReflection_HasAnimal) GetUnknown() protoreflect.RawFields { 1680 return x.unknownFields 1681 } 1682 1683 // SetUnknown stores an entire list of unknown fields. 1684 // The raw fields must be syntactically valid according to the wire format. 1685 // An implementation may panic if this is not the case. 1686 // Once stored, the caller must not mutate the content of the RawFields. 1687 // An empty RawFields may be passed to clear the fields. 1688 // 1689 // SetUnknown is a mutating operation and unsafe for concurrent use. 1690 func (x *fastReflection_HasAnimal) SetUnknown(fields protoreflect.RawFields) { 1691 x.unknownFields = fields 1692 } 1693 1694 // IsValid reports whether the message is valid. 1695 // 1696 // An invalid message is an empty, read-only value. 1697 // 1698 // An invalid message often corresponds to a nil pointer of the concrete 1699 // message type, but the details are implementation dependent. 1700 // Validity is not part of the protobuf data model, and may not 1701 // be preserved in marshaling or other operations. 1702 func (x *fastReflection_HasAnimal) IsValid() bool { 1703 return x != nil 1704 } 1705 1706 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 1707 // This method may return nil. 1708 // 1709 // The returned methods type is identical to 1710 // "google.golang.org/protobuf/runtime/protoiface".Methods. 1711 // Consult the protoiface package documentation for details. 1712 func (x *fastReflection_HasAnimal) ProtoMethods() *protoiface.Methods { 1713 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 1714 x := input.Message.Interface().(*HasAnimal) 1715 if x == nil { 1716 return protoiface.SizeOutput{ 1717 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1718 Size: 0, 1719 } 1720 } 1721 options := runtime.SizeInputToOptions(input) 1722 _ = options 1723 var n int 1724 var l int 1725 _ = l 1726 if x.Animal != nil { 1727 l = options.Size(x.Animal) 1728 n += 1 + l + runtime.Sov(uint64(l)) 1729 } 1730 if x.X != 0 { 1731 n += 1 + runtime.Sov(uint64(x.X)) 1732 } 1733 if x.unknownFields != nil { 1734 n += len(x.unknownFields) 1735 } 1736 return protoiface.SizeOutput{ 1737 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1738 Size: n, 1739 } 1740 } 1741 1742 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 1743 x := input.Message.Interface().(*HasAnimal) 1744 if x == nil { 1745 return protoiface.MarshalOutput{ 1746 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1747 Buf: input.Buf, 1748 }, nil 1749 } 1750 options := runtime.MarshalInputToOptions(input) 1751 _ = options 1752 size := options.Size(x) 1753 dAtA := make([]byte, size) 1754 i := len(dAtA) 1755 _ = i 1756 var l int 1757 _ = l 1758 if x.unknownFields != nil { 1759 i -= len(x.unknownFields) 1760 copy(dAtA[i:], x.unknownFields) 1761 } 1762 if x.X != 0 { 1763 i = runtime.EncodeVarint(dAtA, i, uint64(x.X)) 1764 i-- 1765 dAtA[i] = 0x10 1766 } 1767 if x.Animal != nil { 1768 encoded, err := options.Marshal(x.Animal) 1769 if err != nil { 1770 return protoiface.MarshalOutput{ 1771 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1772 Buf: input.Buf, 1773 }, err 1774 } 1775 i -= len(encoded) 1776 copy(dAtA[i:], encoded) 1777 i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) 1778 i-- 1779 dAtA[i] = 0xa 1780 } 1781 if input.Buf != nil { 1782 input.Buf = append(input.Buf, dAtA...) 1783 } else { 1784 input.Buf = dAtA 1785 } 1786 return protoiface.MarshalOutput{ 1787 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1788 Buf: input.Buf, 1789 }, nil 1790 } 1791 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 1792 x := input.Message.Interface().(*HasAnimal) 1793 if x == nil { 1794 return protoiface.UnmarshalOutput{ 1795 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 1796 Flags: input.Flags, 1797 }, nil 1798 } 1799 options := runtime.UnmarshalInputToOptions(input) 1800 _ = options 1801 dAtA := input.Buf 1802 l := len(dAtA) 1803 iNdEx := 0 1804 for iNdEx < l { 1805 preIndex := iNdEx 1806 var wire uint64 1807 for shift := uint(0); ; shift += 7 { 1808 if shift >= 64 { 1809 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 1810 } 1811 if iNdEx >= l { 1812 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1813 } 1814 b := dAtA[iNdEx] 1815 iNdEx++ 1816 wire |= uint64(b&0x7F) << shift 1817 if b < 0x80 { 1818 break 1819 } 1820 } 1821 fieldNum := int32(wire >> 3) 1822 wireType := int(wire & 0x7) 1823 if wireType == 4 { 1824 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasAnimal: wiretype end group for non-group") 1825 } 1826 if fieldNum <= 0 { 1827 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) 1828 } 1829 switch fieldNum { 1830 case 1: 1831 if wireType != 2 { 1832 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Animal", wireType) 1833 } 1834 var msglen int 1835 for shift := uint(0); ; shift += 7 { 1836 if shift >= 64 { 1837 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 1838 } 1839 if iNdEx >= l { 1840 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1841 } 1842 b := dAtA[iNdEx] 1843 iNdEx++ 1844 msglen |= int(b&0x7F) << shift 1845 if b < 0x80 { 1846 break 1847 } 1848 } 1849 if msglen < 0 { 1850 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 1851 } 1852 postIndex := iNdEx + msglen 1853 if postIndex < 0 { 1854 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 1855 } 1856 if postIndex > l { 1857 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1858 } 1859 if x.Animal == nil { 1860 x.Animal = &anypb.Any{} 1861 } 1862 if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Animal); err != nil { 1863 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 1864 } 1865 iNdEx = postIndex 1866 case 2: 1867 if wireType != 0 { 1868 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field X", wireType) 1869 } 1870 x.X = 0 1871 for shift := uint(0); ; shift += 7 { 1872 if shift >= 64 { 1873 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 1874 } 1875 if iNdEx >= l { 1876 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1877 } 1878 b := dAtA[iNdEx] 1879 iNdEx++ 1880 x.X |= int64(b&0x7F) << shift 1881 if b < 0x80 { 1882 break 1883 } 1884 } 1885 default: 1886 iNdEx = preIndex 1887 skippy, err := runtime.Skip(dAtA[iNdEx:]) 1888 if err != nil { 1889 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 1890 } 1891 if (skippy < 0) || (iNdEx+skippy) < 0 { 1892 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 1893 } 1894 if (iNdEx + skippy) > l { 1895 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1896 } 1897 if !options.DiscardUnknown { 1898 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 1899 } 1900 iNdEx += skippy 1901 } 1902 } 1903 1904 if iNdEx > l { 1905 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 1906 } 1907 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 1908 } 1909 return &protoiface.Methods{ 1910 NoUnkeyedLiterals: struct{}{}, 1911 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 1912 Size: size, 1913 Marshal: marshal, 1914 Unmarshal: unmarshal, 1915 Merge: nil, 1916 CheckInitialized: nil, 1917 } 1918 } 1919 1920 var ( 1921 md_HasHasAnimal protoreflect.MessageDescriptor 1922 fd_HasHasAnimal_has_animal protoreflect.FieldDescriptor 1923 ) 1924 1925 func init() { 1926 file_testpb_testdata_proto_init() 1927 md_HasHasAnimal = File_testpb_testdata_proto.Messages().ByName("HasHasAnimal") 1928 fd_HasHasAnimal_has_animal = md_HasHasAnimal.Fields().ByName("has_animal") 1929 } 1930 1931 var _ protoreflect.Message = (*fastReflection_HasHasAnimal)(nil) 1932 1933 type fastReflection_HasHasAnimal HasHasAnimal 1934 1935 func (x *HasHasAnimal) ProtoReflect() protoreflect.Message { 1936 return (*fastReflection_HasHasAnimal)(x) 1937 } 1938 1939 func (x *HasHasAnimal) slowProtoReflect() protoreflect.Message { 1940 mi := &file_testpb_testdata_proto_msgTypes[4] 1941 if protoimpl.UnsafeEnabled && x != nil { 1942 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1943 if ms.LoadMessageInfo() == nil { 1944 ms.StoreMessageInfo(mi) 1945 } 1946 return ms 1947 } 1948 return mi.MessageOf(x) 1949 } 1950 1951 var _fastReflection_HasHasAnimal_messageType fastReflection_HasHasAnimal_messageType 1952 var _ protoreflect.MessageType = fastReflection_HasHasAnimal_messageType{} 1953 1954 type fastReflection_HasHasAnimal_messageType struct{} 1955 1956 func (x fastReflection_HasHasAnimal_messageType) Zero() protoreflect.Message { 1957 return (*fastReflection_HasHasAnimal)(nil) 1958 } 1959 func (x fastReflection_HasHasAnimal_messageType) New() protoreflect.Message { 1960 return new(fastReflection_HasHasAnimal) 1961 } 1962 func (x fastReflection_HasHasAnimal_messageType) Descriptor() protoreflect.MessageDescriptor { 1963 return md_HasHasAnimal 1964 } 1965 1966 // Descriptor returns message descriptor, which contains only the protobuf 1967 // type information for the message. 1968 func (x *fastReflection_HasHasAnimal) Descriptor() protoreflect.MessageDescriptor { 1969 return md_HasHasAnimal 1970 } 1971 1972 // Type returns the message type, which encapsulates both Go and protobuf 1973 // type information. If the Go type information is not needed, 1974 // it is recommended that the message descriptor be used instead. 1975 func (x *fastReflection_HasHasAnimal) Type() protoreflect.MessageType { 1976 return _fastReflection_HasHasAnimal_messageType 1977 } 1978 1979 // New returns a newly allocated and mutable empty message. 1980 func (x *fastReflection_HasHasAnimal) New() protoreflect.Message { 1981 return new(fastReflection_HasHasAnimal) 1982 } 1983 1984 // Interface unwraps the message reflection interface and 1985 // returns the underlying ProtoMessage interface. 1986 func (x *fastReflection_HasHasAnimal) Interface() protoreflect.ProtoMessage { 1987 return (*HasHasAnimal)(x) 1988 } 1989 1990 // Range iterates over every populated field in an undefined order, 1991 // calling f for each field descriptor and value encountered. 1992 // Range returns immediately if f returns false. 1993 // While iterating, mutating operations may only be performed 1994 // on the current field descriptor. 1995 func (x *fastReflection_HasHasAnimal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 1996 if x.HasAnimal != nil { 1997 value := protoreflect.ValueOfMessage(x.HasAnimal.ProtoReflect()) 1998 if !f(fd_HasHasAnimal_has_animal, value) { 1999 return 2000 } 2001 } 2002 } 2003 2004 // Has reports whether a field is populated. 2005 // 2006 // Some fields have the property of nullability where it is possible to 2007 // distinguish between the default value of a field and whether the field 2008 // was explicitly populated with the default value. Singular message fields, 2009 // member fields of a oneof, and proto2 scalar fields are nullable. Such 2010 // fields are populated only if explicitly set. 2011 // 2012 // In other cases (aside from the nullable cases above), 2013 // a proto3 scalar field is populated if it contains a non-zero value, and 2014 // a repeated field is populated if it is non-empty. 2015 func (x *fastReflection_HasHasAnimal) Has(fd protoreflect.FieldDescriptor) bool { 2016 switch fd.FullName() { 2017 case "testpb.HasHasAnimal.has_animal": 2018 return x.HasAnimal != nil 2019 default: 2020 if fd.IsExtension() { 2021 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasAnimal")) 2022 } 2023 panic(fmt.Errorf("message testpb.HasHasAnimal does not contain field %s", fd.FullName())) 2024 } 2025 } 2026 2027 // Clear clears the field such that a subsequent Has call reports false. 2028 // 2029 // Clearing an extension field clears both the extension type and value 2030 // associated with the given field number. 2031 // 2032 // Clear is a mutating operation and unsafe for concurrent use. 2033 func (x *fastReflection_HasHasAnimal) Clear(fd protoreflect.FieldDescriptor) { 2034 switch fd.FullName() { 2035 case "testpb.HasHasAnimal.has_animal": 2036 x.HasAnimal = nil 2037 default: 2038 if fd.IsExtension() { 2039 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasAnimal")) 2040 } 2041 panic(fmt.Errorf("message testpb.HasHasAnimal does not contain field %s", fd.FullName())) 2042 } 2043 } 2044 2045 // Get retrieves the value for a field. 2046 // 2047 // For unpopulated scalars, it returns the default value, where 2048 // the default value of a bytes scalar is guaranteed to be a copy. 2049 // For unpopulated composite types, it returns an empty, read-only view 2050 // of the value; to obtain a mutable reference, use Mutable. 2051 func (x *fastReflection_HasHasAnimal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 2052 switch descriptor.FullName() { 2053 case "testpb.HasHasAnimal.has_animal": 2054 value := x.HasAnimal 2055 return protoreflect.ValueOfMessage(value.ProtoReflect()) 2056 default: 2057 if descriptor.IsExtension() { 2058 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasAnimal")) 2059 } 2060 panic(fmt.Errorf("message testpb.HasHasAnimal does not contain field %s", descriptor.FullName())) 2061 } 2062 } 2063 2064 // Set stores the value for a field. 2065 // 2066 // For a field belonging to a oneof, it implicitly clears any other field 2067 // that may be currently set within the same oneof. 2068 // For extension fields, it implicitly stores the provided ExtensionType. 2069 // When setting a composite type, it is unspecified whether the stored value 2070 // aliases the source's memory in any way. If the composite value is an 2071 // empty, read-only value, then it panics. 2072 // 2073 // Set is a mutating operation and unsafe for concurrent use. 2074 func (x *fastReflection_HasHasAnimal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 2075 switch fd.FullName() { 2076 case "testpb.HasHasAnimal.has_animal": 2077 x.HasAnimal = value.Message().Interface().(*anypb.Any) 2078 default: 2079 if fd.IsExtension() { 2080 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasAnimal")) 2081 } 2082 panic(fmt.Errorf("message testpb.HasHasAnimal does not contain field %s", fd.FullName())) 2083 } 2084 } 2085 2086 // Mutable returns a mutable reference to a composite type. 2087 // 2088 // If the field is unpopulated, it may allocate a composite value. 2089 // For a field belonging to a oneof, it implicitly clears any other field 2090 // that may be currently set within the same oneof. 2091 // For extension fields, it implicitly stores the provided ExtensionType 2092 // if not already stored. 2093 // It panics if the field does not contain a composite type. 2094 // 2095 // Mutable is a mutating operation and unsafe for concurrent use. 2096 func (x *fastReflection_HasHasAnimal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 2097 switch fd.FullName() { 2098 case "testpb.HasHasAnimal.has_animal": 2099 if x.HasAnimal == nil { 2100 x.HasAnimal = new(anypb.Any) 2101 } 2102 return protoreflect.ValueOfMessage(x.HasAnimal.ProtoReflect()) 2103 default: 2104 if fd.IsExtension() { 2105 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasAnimal")) 2106 } 2107 panic(fmt.Errorf("message testpb.HasHasAnimal does not contain field %s", fd.FullName())) 2108 } 2109 } 2110 2111 // NewField returns a new value that is assignable to the field 2112 // for the given descriptor. For scalars, this returns the default value. 2113 // For lists, maps, and messages, this returns a new, empty, mutable value. 2114 func (x *fastReflection_HasHasAnimal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 2115 switch fd.FullName() { 2116 case "testpb.HasHasAnimal.has_animal": 2117 m := new(anypb.Any) 2118 return protoreflect.ValueOfMessage(m.ProtoReflect()) 2119 default: 2120 if fd.IsExtension() { 2121 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasAnimal")) 2122 } 2123 panic(fmt.Errorf("message testpb.HasHasAnimal does not contain field %s", fd.FullName())) 2124 } 2125 } 2126 2127 // WhichOneof reports which field within the oneof is populated, 2128 // returning nil if none are populated. 2129 // It panics if the oneof descriptor does not belong to this message. 2130 func (x *fastReflection_HasHasAnimal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 2131 switch d.FullName() { 2132 default: 2133 panic(fmt.Errorf("%s is not a oneof field in testpb.HasHasAnimal", d.FullName())) 2134 } 2135 panic("unreachable") 2136 } 2137 2138 // GetUnknown retrieves the entire list of unknown fields. 2139 // The caller may only mutate the contents of the RawFields 2140 // if the mutated bytes are stored back into the message with SetUnknown. 2141 func (x *fastReflection_HasHasAnimal) GetUnknown() protoreflect.RawFields { 2142 return x.unknownFields 2143 } 2144 2145 // SetUnknown stores an entire list of unknown fields. 2146 // The raw fields must be syntactically valid according to the wire format. 2147 // An implementation may panic if this is not the case. 2148 // Once stored, the caller must not mutate the content of the RawFields. 2149 // An empty RawFields may be passed to clear the fields. 2150 // 2151 // SetUnknown is a mutating operation and unsafe for concurrent use. 2152 func (x *fastReflection_HasHasAnimal) SetUnknown(fields protoreflect.RawFields) { 2153 x.unknownFields = fields 2154 } 2155 2156 // IsValid reports whether the message is valid. 2157 // 2158 // An invalid message is an empty, read-only value. 2159 // 2160 // An invalid message often corresponds to a nil pointer of the concrete 2161 // message type, but the details are implementation dependent. 2162 // Validity is not part of the protobuf data model, and may not 2163 // be preserved in marshaling or other operations. 2164 func (x *fastReflection_HasHasAnimal) IsValid() bool { 2165 return x != nil 2166 } 2167 2168 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 2169 // This method may return nil. 2170 // 2171 // The returned methods type is identical to 2172 // "google.golang.org/protobuf/runtime/protoiface".Methods. 2173 // Consult the protoiface package documentation for details. 2174 func (x *fastReflection_HasHasAnimal) ProtoMethods() *protoiface.Methods { 2175 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 2176 x := input.Message.Interface().(*HasHasAnimal) 2177 if x == nil { 2178 return protoiface.SizeOutput{ 2179 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2180 Size: 0, 2181 } 2182 } 2183 options := runtime.SizeInputToOptions(input) 2184 _ = options 2185 var n int 2186 var l int 2187 _ = l 2188 if x.HasAnimal != nil { 2189 l = options.Size(x.HasAnimal) 2190 n += 1 + l + runtime.Sov(uint64(l)) 2191 } 2192 if x.unknownFields != nil { 2193 n += len(x.unknownFields) 2194 } 2195 return protoiface.SizeOutput{ 2196 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2197 Size: n, 2198 } 2199 } 2200 2201 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 2202 x := input.Message.Interface().(*HasHasAnimal) 2203 if x == nil { 2204 return protoiface.MarshalOutput{ 2205 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2206 Buf: input.Buf, 2207 }, nil 2208 } 2209 options := runtime.MarshalInputToOptions(input) 2210 _ = options 2211 size := options.Size(x) 2212 dAtA := make([]byte, size) 2213 i := len(dAtA) 2214 _ = i 2215 var l int 2216 _ = l 2217 if x.unknownFields != nil { 2218 i -= len(x.unknownFields) 2219 copy(dAtA[i:], x.unknownFields) 2220 } 2221 if x.HasAnimal != nil { 2222 encoded, err := options.Marshal(x.HasAnimal) 2223 if err != nil { 2224 return protoiface.MarshalOutput{ 2225 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2226 Buf: input.Buf, 2227 }, err 2228 } 2229 i -= len(encoded) 2230 copy(dAtA[i:], encoded) 2231 i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) 2232 i-- 2233 dAtA[i] = 0xa 2234 } 2235 if input.Buf != nil { 2236 input.Buf = append(input.Buf, dAtA...) 2237 } else { 2238 input.Buf = dAtA 2239 } 2240 return protoiface.MarshalOutput{ 2241 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2242 Buf: input.Buf, 2243 }, nil 2244 } 2245 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 2246 x := input.Message.Interface().(*HasHasAnimal) 2247 if x == nil { 2248 return protoiface.UnmarshalOutput{ 2249 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2250 Flags: input.Flags, 2251 }, nil 2252 } 2253 options := runtime.UnmarshalInputToOptions(input) 2254 _ = options 2255 dAtA := input.Buf 2256 l := len(dAtA) 2257 iNdEx := 0 2258 for iNdEx < l { 2259 preIndex := iNdEx 2260 var wire uint64 2261 for shift := uint(0); ; shift += 7 { 2262 if shift >= 64 { 2263 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 2264 } 2265 if iNdEx >= l { 2266 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2267 } 2268 b := dAtA[iNdEx] 2269 iNdEx++ 2270 wire |= uint64(b&0x7F) << shift 2271 if b < 0x80 { 2272 break 2273 } 2274 } 2275 fieldNum := int32(wire >> 3) 2276 wireType := int(wire & 0x7) 2277 if wireType == 4 { 2278 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasAnimal: wiretype end group for non-group") 2279 } 2280 if fieldNum <= 0 { 2281 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) 2282 } 2283 switch fieldNum { 2284 case 1: 2285 if wireType != 2 { 2286 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) 2287 } 2288 var msglen int 2289 for shift := uint(0); ; shift += 7 { 2290 if shift >= 64 { 2291 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 2292 } 2293 if iNdEx >= l { 2294 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2295 } 2296 b := dAtA[iNdEx] 2297 iNdEx++ 2298 msglen |= int(b&0x7F) << shift 2299 if b < 0x80 { 2300 break 2301 } 2302 } 2303 if msglen < 0 { 2304 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 2305 } 2306 postIndex := iNdEx + msglen 2307 if postIndex < 0 { 2308 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 2309 } 2310 if postIndex > l { 2311 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2312 } 2313 if x.HasAnimal == nil { 2314 x.HasAnimal = &anypb.Any{} 2315 } 2316 if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.HasAnimal); err != nil { 2317 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 2318 } 2319 iNdEx = postIndex 2320 default: 2321 iNdEx = preIndex 2322 skippy, err := runtime.Skip(dAtA[iNdEx:]) 2323 if err != nil { 2324 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 2325 } 2326 if (skippy < 0) || (iNdEx+skippy) < 0 { 2327 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 2328 } 2329 if (iNdEx + skippy) > l { 2330 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2331 } 2332 if !options.DiscardUnknown { 2333 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 2334 } 2335 iNdEx += skippy 2336 } 2337 } 2338 2339 if iNdEx > l { 2340 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2341 } 2342 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 2343 } 2344 return &protoiface.Methods{ 2345 NoUnkeyedLiterals: struct{}{}, 2346 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 2347 Size: size, 2348 Marshal: marshal, 2349 Unmarshal: unmarshal, 2350 Merge: nil, 2351 CheckInitialized: nil, 2352 } 2353 } 2354 2355 var ( 2356 md_HasHasHasAnimal protoreflect.MessageDescriptor 2357 fd_HasHasHasAnimal_has_has_animal protoreflect.FieldDescriptor 2358 ) 2359 2360 func init() { 2361 file_testpb_testdata_proto_init() 2362 md_HasHasHasAnimal = File_testpb_testdata_proto.Messages().ByName("HasHasHasAnimal") 2363 fd_HasHasHasAnimal_has_has_animal = md_HasHasHasAnimal.Fields().ByName("has_has_animal") 2364 } 2365 2366 var _ protoreflect.Message = (*fastReflection_HasHasHasAnimal)(nil) 2367 2368 type fastReflection_HasHasHasAnimal HasHasHasAnimal 2369 2370 func (x *HasHasHasAnimal) ProtoReflect() protoreflect.Message { 2371 return (*fastReflection_HasHasHasAnimal)(x) 2372 } 2373 2374 func (x *HasHasHasAnimal) slowProtoReflect() protoreflect.Message { 2375 mi := &file_testpb_testdata_proto_msgTypes[5] 2376 if protoimpl.UnsafeEnabled && x != nil { 2377 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 2378 if ms.LoadMessageInfo() == nil { 2379 ms.StoreMessageInfo(mi) 2380 } 2381 return ms 2382 } 2383 return mi.MessageOf(x) 2384 } 2385 2386 var _fastReflection_HasHasHasAnimal_messageType fastReflection_HasHasHasAnimal_messageType 2387 var _ protoreflect.MessageType = fastReflection_HasHasHasAnimal_messageType{} 2388 2389 type fastReflection_HasHasHasAnimal_messageType struct{} 2390 2391 func (x fastReflection_HasHasHasAnimal_messageType) Zero() protoreflect.Message { 2392 return (*fastReflection_HasHasHasAnimal)(nil) 2393 } 2394 func (x fastReflection_HasHasHasAnimal_messageType) New() protoreflect.Message { 2395 return new(fastReflection_HasHasHasAnimal) 2396 } 2397 func (x fastReflection_HasHasHasAnimal_messageType) Descriptor() protoreflect.MessageDescriptor { 2398 return md_HasHasHasAnimal 2399 } 2400 2401 // Descriptor returns message descriptor, which contains only the protobuf 2402 // type information for the message. 2403 func (x *fastReflection_HasHasHasAnimal) Descriptor() protoreflect.MessageDescriptor { 2404 return md_HasHasHasAnimal 2405 } 2406 2407 // Type returns the message type, which encapsulates both Go and protobuf 2408 // type information. If the Go type information is not needed, 2409 // it is recommended that the message descriptor be used instead. 2410 func (x *fastReflection_HasHasHasAnimal) Type() protoreflect.MessageType { 2411 return _fastReflection_HasHasHasAnimal_messageType 2412 } 2413 2414 // New returns a newly allocated and mutable empty message. 2415 func (x *fastReflection_HasHasHasAnimal) New() protoreflect.Message { 2416 return new(fastReflection_HasHasHasAnimal) 2417 } 2418 2419 // Interface unwraps the message reflection interface and 2420 // returns the underlying ProtoMessage interface. 2421 func (x *fastReflection_HasHasHasAnimal) Interface() protoreflect.ProtoMessage { 2422 return (*HasHasHasAnimal)(x) 2423 } 2424 2425 // Range iterates over every populated field in an undefined order, 2426 // calling f for each field descriptor and value encountered. 2427 // Range returns immediately if f returns false. 2428 // While iterating, mutating operations may only be performed 2429 // on the current field descriptor. 2430 func (x *fastReflection_HasHasHasAnimal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 2431 if x.HasHasAnimal != nil { 2432 value := protoreflect.ValueOfMessage(x.HasHasAnimal.ProtoReflect()) 2433 if !f(fd_HasHasHasAnimal_has_has_animal, value) { 2434 return 2435 } 2436 } 2437 } 2438 2439 // Has reports whether a field is populated. 2440 // 2441 // Some fields have the property of nullability where it is possible to 2442 // distinguish between the default value of a field and whether the field 2443 // was explicitly populated with the default value. Singular message fields, 2444 // member fields of a oneof, and proto2 scalar fields are nullable. Such 2445 // fields are populated only if explicitly set. 2446 // 2447 // In other cases (aside from the nullable cases above), 2448 // a proto3 scalar field is populated if it contains a non-zero value, and 2449 // a repeated field is populated if it is non-empty. 2450 func (x *fastReflection_HasHasHasAnimal) Has(fd protoreflect.FieldDescriptor) bool { 2451 switch fd.FullName() { 2452 case "testpb.HasHasHasAnimal.has_has_animal": 2453 return x.HasHasAnimal != nil 2454 default: 2455 if fd.IsExtension() { 2456 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasHasAnimal")) 2457 } 2458 panic(fmt.Errorf("message testpb.HasHasHasAnimal does not contain field %s", fd.FullName())) 2459 } 2460 } 2461 2462 // Clear clears the field such that a subsequent Has call reports false. 2463 // 2464 // Clearing an extension field clears both the extension type and value 2465 // associated with the given field number. 2466 // 2467 // Clear is a mutating operation and unsafe for concurrent use. 2468 func (x *fastReflection_HasHasHasAnimal) Clear(fd protoreflect.FieldDescriptor) { 2469 switch fd.FullName() { 2470 case "testpb.HasHasHasAnimal.has_has_animal": 2471 x.HasHasAnimal = nil 2472 default: 2473 if fd.IsExtension() { 2474 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasHasAnimal")) 2475 } 2476 panic(fmt.Errorf("message testpb.HasHasHasAnimal does not contain field %s", fd.FullName())) 2477 } 2478 } 2479 2480 // Get retrieves the value for a field. 2481 // 2482 // For unpopulated scalars, it returns the default value, where 2483 // the default value of a bytes scalar is guaranteed to be a copy. 2484 // For unpopulated composite types, it returns an empty, read-only view 2485 // of the value; to obtain a mutable reference, use Mutable. 2486 func (x *fastReflection_HasHasHasAnimal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 2487 switch descriptor.FullName() { 2488 case "testpb.HasHasHasAnimal.has_has_animal": 2489 value := x.HasHasAnimal 2490 return protoreflect.ValueOfMessage(value.ProtoReflect()) 2491 default: 2492 if descriptor.IsExtension() { 2493 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasHasAnimal")) 2494 } 2495 panic(fmt.Errorf("message testpb.HasHasHasAnimal does not contain field %s", descriptor.FullName())) 2496 } 2497 } 2498 2499 // Set stores the value for a field. 2500 // 2501 // For a field belonging to a oneof, it implicitly clears any other field 2502 // that may be currently set within the same oneof. 2503 // For extension fields, it implicitly stores the provided ExtensionType. 2504 // When setting a composite type, it is unspecified whether the stored value 2505 // aliases the source's memory in any way. If the composite value is an 2506 // empty, read-only value, then it panics. 2507 // 2508 // Set is a mutating operation and unsafe for concurrent use. 2509 func (x *fastReflection_HasHasHasAnimal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 2510 switch fd.FullName() { 2511 case "testpb.HasHasHasAnimal.has_has_animal": 2512 x.HasHasAnimal = value.Message().Interface().(*anypb.Any) 2513 default: 2514 if fd.IsExtension() { 2515 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasHasAnimal")) 2516 } 2517 panic(fmt.Errorf("message testpb.HasHasHasAnimal does not contain field %s", fd.FullName())) 2518 } 2519 } 2520 2521 // Mutable returns a mutable reference to a composite type. 2522 // 2523 // If the field is unpopulated, it may allocate a composite value. 2524 // For a field belonging to a oneof, it implicitly clears any other field 2525 // that may be currently set within the same oneof. 2526 // For extension fields, it implicitly stores the provided ExtensionType 2527 // if not already stored. 2528 // It panics if the field does not contain a composite type. 2529 // 2530 // Mutable is a mutating operation and unsafe for concurrent use. 2531 func (x *fastReflection_HasHasHasAnimal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 2532 switch fd.FullName() { 2533 case "testpb.HasHasHasAnimal.has_has_animal": 2534 if x.HasHasAnimal == nil { 2535 x.HasHasAnimal = new(anypb.Any) 2536 } 2537 return protoreflect.ValueOfMessage(x.HasHasAnimal.ProtoReflect()) 2538 default: 2539 if fd.IsExtension() { 2540 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasHasAnimal")) 2541 } 2542 panic(fmt.Errorf("message testpb.HasHasHasAnimal does not contain field %s", fd.FullName())) 2543 } 2544 } 2545 2546 // NewField returns a new value that is assignable to the field 2547 // for the given descriptor. For scalars, this returns the default value. 2548 // For lists, maps, and messages, this returns a new, empty, mutable value. 2549 func (x *fastReflection_HasHasHasAnimal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 2550 switch fd.FullName() { 2551 case "testpb.HasHasHasAnimal.has_has_animal": 2552 m := new(anypb.Any) 2553 return protoreflect.ValueOfMessage(m.ProtoReflect()) 2554 default: 2555 if fd.IsExtension() { 2556 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.HasHasHasAnimal")) 2557 } 2558 panic(fmt.Errorf("message testpb.HasHasHasAnimal does not contain field %s", fd.FullName())) 2559 } 2560 } 2561 2562 // WhichOneof reports which field within the oneof is populated, 2563 // returning nil if none are populated. 2564 // It panics if the oneof descriptor does not belong to this message. 2565 func (x *fastReflection_HasHasHasAnimal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 2566 switch d.FullName() { 2567 default: 2568 panic(fmt.Errorf("%s is not a oneof field in testpb.HasHasHasAnimal", d.FullName())) 2569 } 2570 panic("unreachable") 2571 } 2572 2573 // GetUnknown retrieves the entire list of unknown fields. 2574 // The caller may only mutate the contents of the RawFields 2575 // if the mutated bytes are stored back into the message with SetUnknown. 2576 func (x *fastReflection_HasHasHasAnimal) GetUnknown() protoreflect.RawFields { 2577 return x.unknownFields 2578 } 2579 2580 // SetUnknown stores an entire list of unknown fields. 2581 // The raw fields must be syntactically valid according to the wire format. 2582 // An implementation may panic if this is not the case. 2583 // Once stored, the caller must not mutate the content of the RawFields. 2584 // An empty RawFields may be passed to clear the fields. 2585 // 2586 // SetUnknown is a mutating operation and unsafe for concurrent use. 2587 func (x *fastReflection_HasHasHasAnimal) SetUnknown(fields protoreflect.RawFields) { 2588 x.unknownFields = fields 2589 } 2590 2591 // IsValid reports whether the message is valid. 2592 // 2593 // An invalid message is an empty, read-only value. 2594 // 2595 // An invalid message often corresponds to a nil pointer of the concrete 2596 // message type, but the details are implementation dependent. 2597 // Validity is not part of the protobuf data model, and may not 2598 // be preserved in marshaling or other operations. 2599 func (x *fastReflection_HasHasHasAnimal) IsValid() bool { 2600 return x != nil 2601 } 2602 2603 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 2604 // This method may return nil. 2605 // 2606 // The returned methods type is identical to 2607 // "google.golang.org/protobuf/runtime/protoiface".Methods. 2608 // Consult the protoiface package documentation for details. 2609 func (x *fastReflection_HasHasHasAnimal) ProtoMethods() *protoiface.Methods { 2610 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 2611 x := input.Message.Interface().(*HasHasHasAnimal) 2612 if x == nil { 2613 return protoiface.SizeOutput{ 2614 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2615 Size: 0, 2616 } 2617 } 2618 options := runtime.SizeInputToOptions(input) 2619 _ = options 2620 var n int 2621 var l int 2622 _ = l 2623 if x.HasHasAnimal != nil { 2624 l = options.Size(x.HasHasAnimal) 2625 n += 1 + l + runtime.Sov(uint64(l)) 2626 } 2627 if x.unknownFields != nil { 2628 n += len(x.unknownFields) 2629 } 2630 return protoiface.SizeOutput{ 2631 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2632 Size: n, 2633 } 2634 } 2635 2636 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 2637 x := input.Message.Interface().(*HasHasHasAnimal) 2638 if x == nil { 2639 return protoiface.MarshalOutput{ 2640 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2641 Buf: input.Buf, 2642 }, nil 2643 } 2644 options := runtime.MarshalInputToOptions(input) 2645 _ = options 2646 size := options.Size(x) 2647 dAtA := make([]byte, size) 2648 i := len(dAtA) 2649 _ = i 2650 var l int 2651 _ = l 2652 if x.unknownFields != nil { 2653 i -= len(x.unknownFields) 2654 copy(dAtA[i:], x.unknownFields) 2655 } 2656 if x.HasHasAnimal != nil { 2657 encoded, err := options.Marshal(x.HasHasAnimal) 2658 if err != nil { 2659 return protoiface.MarshalOutput{ 2660 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2661 Buf: input.Buf, 2662 }, err 2663 } 2664 i -= len(encoded) 2665 copy(dAtA[i:], encoded) 2666 i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) 2667 i-- 2668 dAtA[i] = 0xa 2669 } 2670 if input.Buf != nil { 2671 input.Buf = append(input.Buf, dAtA...) 2672 } else { 2673 input.Buf = dAtA 2674 } 2675 return protoiface.MarshalOutput{ 2676 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2677 Buf: input.Buf, 2678 }, nil 2679 } 2680 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 2681 x := input.Message.Interface().(*HasHasHasAnimal) 2682 if x == nil { 2683 return protoiface.UnmarshalOutput{ 2684 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 2685 Flags: input.Flags, 2686 }, nil 2687 } 2688 options := runtime.UnmarshalInputToOptions(input) 2689 _ = options 2690 dAtA := input.Buf 2691 l := len(dAtA) 2692 iNdEx := 0 2693 for iNdEx < l { 2694 preIndex := iNdEx 2695 var wire uint64 2696 for shift := uint(0); ; shift += 7 { 2697 if shift >= 64 { 2698 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 2699 } 2700 if iNdEx >= l { 2701 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2702 } 2703 b := dAtA[iNdEx] 2704 iNdEx++ 2705 wire |= uint64(b&0x7F) << shift 2706 if b < 0x80 { 2707 break 2708 } 2709 } 2710 fieldNum := int32(wire >> 3) 2711 wireType := int(wire & 0x7) 2712 if wireType == 4 { 2713 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasHasAnimal: wiretype end group for non-group") 2714 } 2715 if fieldNum <= 0 { 2716 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HasHasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) 2717 } 2718 switch fieldNum { 2719 case 1: 2720 if wireType != 2 { 2721 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HasHasAnimal", wireType) 2722 } 2723 var msglen int 2724 for shift := uint(0); ; shift += 7 { 2725 if shift >= 64 { 2726 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 2727 } 2728 if iNdEx >= l { 2729 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2730 } 2731 b := dAtA[iNdEx] 2732 iNdEx++ 2733 msglen |= int(b&0x7F) << shift 2734 if b < 0x80 { 2735 break 2736 } 2737 } 2738 if msglen < 0 { 2739 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 2740 } 2741 postIndex := iNdEx + msglen 2742 if postIndex < 0 { 2743 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 2744 } 2745 if postIndex > l { 2746 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2747 } 2748 if x.HasHasAnimal == nil { 2749 x.HasHasAnimal = &anypb.Any{} 2750 } 2751 if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.HasHasAnimal); err != nil { 2752 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 2753 } 2754 iNdEx = postIndex 2755 default: 2756 iNdEx = preIndex 2757 skippy, err := runtime.Skip(dAtA[iNdEx:]) 2758 if err != nil { 2759 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 2760 } 2761 if (skippy < 0) || (iNdEx+skippy) < 0 { 2762 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 2763 } 2764 if (iNdEx + skippy) > l { 2765 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2766 } 2767 if !options.DiscardUnknown { 2768 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 2769 } 2770 iNdEx += skippy 2771 } 2772 } 2773 2774 if iNdEx > l { 2775 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 2776 } 2777 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 2778 } 2779 return &protoiface.Methods{ 2780 NoUnkeyedLiterals: struct{}{}, 2781 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 2782 Size: size, 2783 Marshal: marshal, 2784 Unmarshal: unmarshal, 2785 Merge: nil, 2786 CheckInitialized: nil, 2787 } 2788 } 2789 2790 var _ protoreflect.List = (*_BadMultiSignature_1_list)(nil) 2791 2792 type _BadMultiSignature_1_list struct { 2793 list *[][]byte 2794 } 2795 2796 func (x *_BadMultiSignature_1_list) Len() int { 2797 if x.list == nil { 2798 return 0 2799 } 2800 return len(*x.list) 2801 } 2802 2803 func (x *_BadMultiSignature_1_list) Get(i int) protoreflect.Value { 2804 return protoreflect.ValueOfBytes((*x.list)[i]) 2805 } 2806 2807 func (x *_BadMultiSignature_1_list) Set(i int, value protoreflect.Value) { 2808 valueUnwrapped := value.Bytes() 2809 concreteValue := valueUnwrapped 2810 (*x.list)[i] = concreteValue 2811 } 2812 2813 func (x *_BadMultiSignature_1_list) Append(value protoreflect.Value) { 2814 valueUnwrapped := value.Bytes() 2815 concreteValue := valueUnwrapped 2816 *x.list = append(*x.list, concreteValue) 2817 } 2818 2819 func (x *_BadMultiSignature_1_list) AppendMutable() protoreflect.Value { 2820 panic(fmt.Errorf("AppendMutable can not be called on message BadMultiSignature at list field Signatures as it is not of Message kind")) 2821 } 2822 2823 func (x *_BadMultiSignature_1_list) Truncate(n int) { 2824 *x.list = (*x.list)[:n] 2825 } 2826 2827 func (x *_BadMultiSignature_1_list) NewElement() protoreflect.Value { 2828 var v []byte 2829 return protoreflect.ValueOfBytes(v) 2830 } 2831 2832 func (x *_BadMultiSignature_1_list) IsValid() bool { 2833 return x.list != nil 2834 } 2835 2836 var ( 2837 md_BadMultiSignature protoreflect.MessageDescriptor 2838 fd_BadMultiSignature_signatures protoreflect.FieldDescriptor 2839 fd_BadMultiSignature_malicious_field protoreflect.FieldDescriptor 2840 ) 2841 2842 func init() { 2843 file_testpb_testdata_proto_init() 2844 md_BadMultiSignature = File_testpb_testdata_proto.Messages().ByName("BadMultiSignature") 2845 fd_BadMultiSignature_signatures = md_BadMultiSignature.Fields().ByName("signatures") 2846 fd_BadMultiSignature_malicious_field = md_BadMultiSignature.Fields().ByName("malicious_field") 2847 } 2848 2849 var _ protoreflect.Message = (*fastReflection_BadMultiSignature)(nil) 2850 2851 type fastReflection_BadMultiSignature BadMultiSignature 2852 2853 func (x *BadMultiSignature) ProtoReflect() protoreflect.Message { 2854 return (*fastReflection_BadMultiSignature)(x) 2855 } 2856 2857 func (x *BadMultiSignature) slowProtoReflect() protoreflect.Message { 2858 mi := &file_testpb_testdata_proto_msgTypes[6] 2859 if protoimpl.UnsafeEnabled && x != nil { 2860 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 2861 if ms.LoadMessageInfo() == nil { 2862 ms.StoreMessageInfo(mi) 2863 } 2864 return ms 2865 } 2866 return mi.MessageOf(x) 2867 } 2868 2869 var _fastReflection_BadMultiSignature_messageType fastReflection_BadMultiSignature_messageType 2870 var _ protoreflect.MessageType = fastReflection_BadMultiSignature_messageType{} 2871 2872 type fastReflection_BadMultiSignature_messageType struct{} 2873 2874 func (x fastReflection_BadMultiSignature_messageType) Zero() protoreflect.Message { 2875 return (*fastReflection_BadMultiSignature)(nil) 2876 } 2877 func (x fastReflection_BadMultiSignature_messageType) New() protoreflect.Message { 2878 return new(fastReflection_BadMultiSignature) 2879 } 2880 func (x fastReflection_BadMultiSignature_messageType) Descriptor() protoreflect.MessageDescriptor { 2881 return md_BadMultiSignature 2882 } 2883 2884 // Descriptor returns message descriptor, which contains only the protobuf 2885 // type information for the message. 2886 func (x *fastReflection_BadMultiSignature) Descriptor() protoreflect.MessageDescriptor { 2887 return md_BadMultiSignature 2888 } 2889 2890 // Type returns the message type, which encapsulates both Go and protobuf 2891 // type information. If the Go type information is not needed, 2892 // it is recommended that the message descriptor be used instead. 2893 func (x *fastReflection_BadMultiSignature) Type() protoreflect.MessageType { 2894 return _fastReflection_BadMultiSignature_messageType 2895 } 2896 2897 // New returns a newly allocated and mutable empty message. 2898 func (x *fastReflection_BadMultiSignature) New() protoreflect.Message { 2899 return new(fastReflection_BadMultiSignature) 2900 } 2901 2902 // Interface unwraps the message reflection interface and 2903 // returns the underlying ProtoMessage interface. 2904 func (x *fastReflection_BadMultiSignature) Interface() protoreflect.ProtoMessage { 2905 return (*BadMultiSignature)(x) 2906 } 2907 2908 // Range iterates over every populated field in an undefined order, 2909 // calling f for each field descriptor and value encountered. 2910 // Range returns immediately if f returns false. 2911 // While iterating, mutating operations may only be performed 2912 // on the current field descriptor. 2913 func (x *fastReflection_BadMultiSignature) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 2914 if len(x.Signatures) != 0 { 2915 value := protoreflect.ValueOfList(&_BadMultiSignature_1_list{list: &x.Signatures}) 2916 if !f(fd_BadMultiSignature_signatures, value) { 2917 return 2918 } 2919 } 2920 if len(x.MaliciousField) != 0 { 2921 value := protoreflect.ValueOfBytes(x.MaliciousField) 2922 if !f(fd_BadMultiSignature_malicious_field, value) { 2923 return 2924 } 2925 } 2926 } 2927 2928 // Has reports whether a field is populated. 2929 // 2930 // Some fields have the property of nullability where it is possible to 2931 // distinguish between the default value of a field and whether the field 2932 // was explicitly populated with the default value. Singular message fields, 2933 // member fields of a oneof, and proto2 scalar fields are nullable. Such 2934 // fields are populated only if explicitly set. 2935 // 2936 // In other cases (aside from the nullable cases above), 2937 // a proto3 scalar field is populated if it contains a non-zero value, and 2938 // a repeated field is populated if it is non-empty. 2939 func (x *fastReflection_BadMultiSignature) Has(fd protoreflect.FieldDescriptor) bool { 2940 switch fd.FullName() { 2941 case "testpb.BadMultiSignature.signatures": 2942 return len(x.Signatures) != 0 2943 case "testpb.BadMultiSignature.malicious_field": 2944 return len(x.MaliciousField) != 0 2945 default: 2946 if fd.IsExtension() { 2947 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.BadMultiSignature")) 2948 } 2949 panic(fmt.Errorf("message testpb.BadMultiSignature does not contain field %s", fd.FullName())) 2950 } 2951 } 2952 2953 // Clear clears the field such that a subsequent Has call reports false. 2954 // 2955 // Clearing an extension field clears both the extension type and value 2956 // associated with the given field number. 2957 // 2958 // Clear is a mutating operation and unsafe for concurrent use. 2959 func (x *fastReflection_BadMultiSignature) Clear(fd protoreflect.FieldDescriptor) { 2960 switch fd.FullName() { 2961 case "testpb.BadMultiSignature.signatures": 2962 x.Signatures = nil 2963 case "testpb.BadMultiSignature.malicious_field": 2964 x.MaliciousField = nil 2965 default: 2966 if fd.IsExtension() { 2967 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.BadMultiSignature")) 2968 } 2969 panic(fmt.Errorf("message testpb.BadMultiSignature does not contain field %s", fd.FullName())) 2970 } 2971 } 2972 2973 // Get retrieves the value for a field. 2974 // 2975 // For unpopulated scalars, it returns the default value, where 2976 // the default value of a bytes scalar is guaranteed to be a copy. 2977 // For unpopulated composite types, it returns an empty, read-only view 2978 // of the value; to obtain a mutable reference, use Mutable. 2979 func (x *fastReflection_BadMultiSignature) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 2980 switch descriptor.FullName() { 2981 case "testpb.BadMultiSignature.signatures": 2982 if len(x.Signatures) == 0 { 2983 return protoreflect.ValueOfList(&_BadMultiSignature_1_list{}) 2984 } 2985 listValue := &_BadMultiSignature_1_list{list: &x.Signatures} 2986 return protoreflect.ValueOfList(listValue) 2987 case "testpb.BadMultiSignature.malicious_field": 2988 value := x.MaliciousField 2989 return protoreflect.ValueOfBytes(value) 2990 default: 2991 if descriptor.IsExtension() { 2992 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.BadMultiSignature")) 2993 } 2994 panic(fmt.Errorf("message testpb.BadMultiSignature does not contain field %s", descriptor.FullName())) 2995 } 2996 } 2997 2998 // Set stores the value for a field. 2999 // 3000 // For a field belonging to a oneof, it implicitly clears any other field 3001 // that may be currently set within the same oneof. 3002 // For extension fields, it implicitly stores the provided ExtensionType. 3003 // When setting a composite type, it is unspecified whether the stored value 3004 // aliases the source's memory in any way. If the composite value is an 3005 // empty, read-only value, then it panics. 3006 // 3007 // Set is a mutating operation and unsafe for concurrent use. 3008 func (x *fastReflection_BadMultiSignature) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 3009 switch fd.FullName() { 3010 case "testpb.BadMultiSignature.signatures": 3011 lv := value.List() 3012 clv := lv.(*_BadMultiSignature_1_list) 3013 x.Signatures = *clv.list 3014 case "testpb.BadMultiSignature.malicious_field": 3015 x.MaliciousField = value.Bytes() 3016 default: 3017 if fd.IsExtension() { 3018 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.BadMultiSignature")) 3019 } 3020 panic(fmt.Errorf("message testpb.BadMultiSignature does not contain field %s", fd.FullName())) 3021 } 3022 } 3023 3024 // Mutable returns a mutable reference to a composite type. 3025 // 3026 // If the field is unpopulated, it may allocate a composite value. 3027 // For a field belonging to a oneof, it implicitly clears any other field 3028 // that may be currently set within the same oneof. 3029 // For extension fields, it implicitly stores the provided ExtensionType 3030 // if not already stored. 3031 // It panics if the field does not contain a composite type. 3032 // 3033 // Mutable is a mutating operation and unsafe for concurrent use. 3034 func (x *fastReflection_BadMultiSignature) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 3035 switch fd.FullName() { 3036 case "testpb.BadMultiSignature.signatures": 3037 if x.Signatures == nil { 3038 x.Signatures = [][]byte{} 3039 } 3040 value := &_BadMultiSignature_1_list{list: &x.Signatures} 3041 return protoreflect.ValueOfList(value) 3042 case "testpb.BadMultiSignature.malicious_field": 3043 panic(fmt.Errorf("field malicious_field of message testpb.BadMultiSignature is not mutable")) 3044 default: 3045 if fd.IsExtension() { 3046 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.BadMultiSignature")) 3047 } 3048 panic(fmt.Errorf("message testpb.BadMultiSignature does not contain field %s", fd.FullName())) 3049 } 3050 } 3051 3052 // NewField returns a new value that is assignable to the field 3053 // for the given descriptor. For scalars, this returns the default value. 3054 // For lists, maps, and messages, this returns a new, empty, mutable value. 3055 func (x *fastReflection_BadMultiSignature) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 3056 switch fd.FullName() { 3057 case "testpb.BadMultiSignature.signatures": 3058 list := [][]byte{} 3059 return protoreflect.ValueOfList(&_BadMultiSignature_1_list{list: &list}) 3060 case "testpb.BadMultiSignature.malicious_field": 3061 return protoreflect.ValueOfBytes(nil) 3062 default: 3063 if fd.IsExtension() { 3064 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.BadMultiSignature")) 3065 } 3066 panic(fmt.Errorf("message testpb.BadMultiSignature does not contain field %s", fd.FullName())) 3067 } 3068 } 3069 3070 // WhichOneof reports which field within the oneof is populated, 3071 // returning nil if none are populated. 3072 // It panics if the oneof descriptor does not belong to this message. 3073 func (x *fastReflection_BadMultiSignature) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 3074 switch d.FullName() { 3075 default: 3076 panic(fmt.Errorf("%s is not a oneof field in testpb.BadMultiSignature", d.FullName())) 3077 } 3078 panic("unreachable") 3079 } 3080 3081 // GetUnknown retrieves the entire list of unknown fields. 3082 // The caller may only mutate the contents of the RawFields 3083 // if the mutated bytes are stored back into the message with SetUnknown. 3084 func (x *fastReflection_BadMultiSignature) GetUnknown() protoreflect.RawFields { 3085 return x.unknownFields 3086 } 3087 3088 // SetUnknown stores an entire list of unknown fields. 3089 // The raw fields must be syntactically valid according to the wire format. 3090 // An implementation may panic if this is not the case. 3091 // Once stored, the caller must not mutate the content of the RawFields. 3092 // An empty RawFields may be passed to clear the fields. 3093 // 3094 // SetUnknown is a mutating operation and unsafe for concurrent use. 3095 func (x *fastReflection_BadMultiSignature) SetUnknown(fields protoreflect.RawFields) { 3096 x.unknownFields = fields 3097 } 3098 3099 // IsValid reports whether the message is valid. 3100 // 3101 // An invalid message is an empty, read-only value. 3102 // 3103 // An invalid message often corresponds to a nil pointer of the concrete 3104 // message type, but the details are implementation dependent. 3105 // Validity is not part of the protobuf data model, and may not 3106 // be preserved in marshaling or other operations. 3107 func (x *fastReflection_BadMultiSignature) IsValid() bool { 3108 return x != nil 3109 } 3110 3111 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 3112 // This method may return nil. 3113 // 3114 // The returned methods type is identical to 3115 // "google.golang.org/protobuf/runtime/protoiface".Methods. 3116 // Consult the protoiface package documentation for details. 3117 func (x *fastReflection_BadMultiSignature) ProtoMethods() *protoiface.Methods { 3118 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 3119 x := input.Message.Interface().(*BadMultiSignature) 3120 if x == nil { 3121 return protoiface.SizeOutput{ 3122 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3123 Size: 0, 3124 } 3125 } 3126 options := runtime.SizeInputToOptions(input) 3127 _ = options 3128 var n int 3129 var l int 3130 _ = l 3131 if len(x.Signatures) > 0 { 3132 for _, b := range x.Signatures { 3133 l = len(b) 3134 n += 1 + l + runtime.Sov(uint64(l)) 3135 } 3136 } 3137 l = len(x.MaliciousField) 3138 if l > 0 { 3139 n += 1 + l + runtime.Sov(uint64(l)) 3140 } 3141 if x.unknownFields != nil { 3142 n += len(x.unknownFields) 3143 } 3144 return protoiface.SizeOutput{ 3145 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3146 Size: n, 3147 } 3148 } 3149 3150 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 3151 x := input.Message.Interface().(*BadMultiSignature) 3152 if x == nil { 3153 return protoiface.MarshalOutput{ 3154 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3155 Buf: input.Buf, 3156 }, nil 3157 } 3158 options := runtime.MarshalInputToOptions(input) 3159 _ = options 3160 size := options.Size(x) 3161 dAtA := make([]byte, size) 3162 i := len(dAtA) 3163 _ = i 3164 var l int 3165 _ = l 3166 if x.unknownFields != nil { 3167 i -= len(x.unknownFields) 3168 copy(dAtA[i:], x.unknownFields) 3169 } 3170 if len(x.MaliciousField) > 0 { 3171 i -= len(x.MaliciousField) 3172 copy(dAtA[i:], x.MaliciousField) 3173 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaliciousField))) 3174 i-- 3175 dAtA[i] = 0x2a 3176 } 3177 if len(x.Signatures) > 0 { 3178 for iNdEx := len(x.Signatures) - 1; iNdEx >= 0; iNdEx-- { 3179 i -= len(x.Signatures[iNdEx]) 3180 copy(dAtA[i:], x.Signatures[iNdEx]) 3181 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signatures[iNdEx]))) 3182 i-- 3183 dAtA[i] = 0xa 3184 } 3185 } 3186 if input.Buf != nil { 3187 input.Buf = append(input.Buf, dAtA...) 3188 } else { 3189 input.Buf = dAtA 3190 } 3191 return protoiface.MarshalOutput{ 3192 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3193 Buf: input.Buf, 3194 }, nil 3195 } 3196 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 3197 x := input.Message.Interface().(*BadMultiSignature) 3198 if x == nil { 3199 return protoiface.UnmarshalOutput{ 3200 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3201 Flags: input.Flags, 3202 }, nil 3203 } 3204 options := runtime.UnmarshalInputToOptions(input) 3205 _ = options 3206 dAtA := input.Buf 3207 l := len(dAtA) 3208 iNdEx := 0 3209 for iNdEx < l { 3210 preIndex := iNdEx 3211 var wire uint64 3212 for shift := uint(0); ; shift += 7 { 3213 if shift >= 64 { 3214 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3215 } 3216 if iNdEx >= l { 3217 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3218 } 3219 b := dAtA[iNdEx] 3220 iNdEx++ 3221 wire |= uint64(b&0x7F) << shift 3222 if b < 0x80 { 3223 break 3224 } 3225 } 3226 fieldNum := int32(wire >> 3) 3227 wireType := int(wire & 0x7) 3228 if wireType == 4 { 3229 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadMultiSignature: wiretype end group for non-group") 3230 } 3231 if fieldNum <= 0 { 3232 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadMultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) 3233 } 3234 switch fieldNum { 3235 case 1: 3236 if wireType != 2 { 3237 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) 3238 } 3239 var byteLen int 3240 for shift := uint(0); ; shift += 7 { 3241 if shift >= 64 { 3242 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3243 } 3244 if iNdEx >= l { 3245 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3246 } 3247 b := dAtA[iNdEx] 3248 iNdEx++ 3249 byteLen |= int(b&0x7F) << shift 3250 if b < 0x80 { 3251 break 3252 } 3253 } 3254 if byteLen < 0 { 3255 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3256 } 3257 postIndex := iNdEx + byteLen 3258 if postIndex < 0 { 3259 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3260 } 3261 if postIndex > l { 3262 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3263 } 3264 x.Signatures = append(x.Signatures, make([]byte, postIndex-iNdEx)) 3265 copy(x.Signatures[len(x.Signatures)-1], dAtA[iNdEx:postIndex]) 3266 iNdEx = postIndex 3267 case 5: 3268 if wireType != 2 { 3269 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaliciousField", wireType) 3270 } 3271 var byteLen int 3272 for shift := uint(0); ; shift += 7 { 3273 if shift >= 64 { 3274 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3275 } 3276 if iNdEx >= l { 3277 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3278 } 3279 b := dAtA[iNdEx] 3280 iNdEx++ 3281 byteLen |= int(b&0x7F) << shift 3282 if b < 0x80 { 3283 break 3284 } 3285 } 3286 if byteLen < 0 { 3287 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3288 } 3289 postIndex := iNdEx + byteLen 3290 if postIndex < 0 { 3291 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3292 } 3293 if postIndex > l { 3294 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3295 } 3296 x.MaliciousField = append(x.MaliciousField[:0], dAtA[iNdEx:postIndex]...) 3297 if x.MaliciousField == nil { 3298 x.MaliciousField = []byte{} 3299 } 3300 iNdEx = postIndex 3301 default: 3302 iNdEx = preIndex 3303 skippy, err := runtime.Skip(dAtA[iNdEx:]) 3304 if err != nil { 3305 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 3306 } 3307 if (skippy < 0) || (iNdEx+skippy) < 0 { 3308 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3309 } 3310 if (iNdEx + skippy) > l { 3311 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3312 } 3313 if !options.DiscardUnknown { 3314 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 3315 } 3316 iNdEx += skippy 3317 } 3318 } 3319 3320 if iNdEx > l { 3321 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3322 } 3323 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 3324 } 3325 return &protoiface.Methods{ 3326 NoUnkeyedLiterals: struct{}{}, 3327 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 3328 Size: size, 3329 Marshal: marshal, 3330 Unmarshal: unmarshal, 3331 Merge: nil, 3332 CheckInitialized: nil, 3333 } 3334 } 3335 3336 var ( 3337 md_TableModel protoreflect.MessageDescriptor 3338 fd_TableModel_id protoreflect.FieldDescriptor 3339 fd_TableModel_name protoreflect.FieldDescriptor 3340 fd_TableModel_number protoreflect.FieldDescriptor 3341 fd_TableModel_metadata protoreflect.FieldDescriptor 3342 ) 3343 3344 func init() { 3345 file_testpb_testdata_proto_init() 3346 md_TableModel = File_testpb_testdata_proto.Messages().ByName("TableModel") 3347 fd_TableModel_id = md_TableModel.Fields().ByName("id") 3348 fd_TableModel_name = md_TableModel.Fields().ByName("name") 3349 fd_TableModel_number = md_TableModel.Fields().ByName("number") 3350 fd_TableModel_metadata = md_TableModel.Fields().ByName("metadata") 3351 } 3352 3353 var _ protoreflect.Message = (*fastReflection_TableModel)(nil) 3354 3355 type fastReflection_TableModel TableModel 3356 3357 func (x *TableModel) ProtoReflect() protoreflect.Message { 3358 return (*fastReflection_TableModel)(x) 3359 } 3360 3361 func (x *TableModel) slowProtoReflect() protoreflect.Message { 3362 mi := &file_testpb_testdata_proto_msgTypes[7] 3363 if protoimpl.UnsafeEnabled && x != nil { 3364 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 3365 if ms.LoadMessageInfo() == nil { 3366 ms.StoreMessageInfo(mi) 3367 } 3368 return ms 3369 } 3370 return mi.MessageOf(x) 3371 } 3372 3373 var _fastReflection_TableModel_messageType fastReflection_TableModel_messageType 3374 var _ protoreflect.MessageType = fastReflection_TableModel_messageType{} 3375 3376 type fastReflection_TableModel_messageType struct{} 3377 3378 func (x fastReflection_TableModel_messageType) Zero() protoreflect.Message { 3379 return (*fastReflection_TableModel)(nil) 3380 } 3381 func (x fastReflection_TableModel_messageType) New() protoreflect.Message { 3382 return new(fastReflection_TableModel) 3383 } 3384 func (x fastReflection_TableModel_messageType) Descriptor() protoreflect.MessageDescriptor { 3385 return md_TableModel 3386 } 3387 3388 // Descriptor returns message descriptor, which contains only the protobuf 3389 // type information for the message. 3390 func (x *fastReflection_TableModel) Descriptor() protoreflect.MessageDescriptor { 3391 return md_TableModel 3392 } 3393 3394 // Type returns the message type, which encapsulates both Go and protobuf 3395 // type information. If the Go type information is not needed, 3396 // it is recommended that the message descriptor be used instead. 3397 func (x *fastReflection_TableModel) Type() protoreflect.MessageType { 3398 return _fastReflection_TableModel_messageType 3399 } 3400 3401 // New returns a newly allocated and mutable empty message. 3402 func (x *fastReflection_TableModel) New() protoreflect.Message { 3403 return new(fastReflection_TableModel) 3404 } 3405 3406 // Interface unwraps the message reflection interface and 3407 // returns the underlying ProtoMessage interface. 3408 func (x *fastReflection_TableModel) Interface() protoreflect.ProtoMessage { 3409 return (*TableModel)(x) 3410 } 3411 3412 // Range iterates over every populated field in an undefined order, 3413 // calling f for each field descriptor and value encountered. 3414 // Range returns immediately if f returns false. 3415 // While iterating, mutating operations may only be performed 3416 // on the current field descriptor. 3417 func (x *fastReflection_TableModel) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { 3418 if x.Id != uint64(0) { 3419 value := protoreflect.ValueOfUint64(x.Id) 3420 if !f(fd_TableModel_id, value) { 3421 return 3422 } 3423 } 3424 if x.Name != "" { 3425 value := protoreflect.ValueOfString(x.Name) 3426 if !f(fd_TableModel_name, value) { 3427 return 3428 } 3429 } 3430 if x.Number != uint64(0) { 3431 value := protoreflect.ValueOfUint64(x.Number) 3432 if !f(fd_TableModel_number, value) { 3433 return 3434 } 3435 } 3436 if len(x.Metadata) != 0 { 3437 value := protoreflect.ValueOfBytes(x.Metadata) 3438 if !f(fd_TableModel_metadata, value) { 3439 return 3440 } 3441 } 3442 } 3443 3444 // Has reports whether a field is populated. 3445 // 3446 // Some fields have the property of nullability where it is possible to 3447 // distinguish between the default value of a field and whether the field 3448 // was explicitly populated with the default value. Singular message fields, 3449 // member fields of a oneof, and proto2 scalar fields are nullable. Such 3450 // fields are populated only if explicitly set. 3451 // 3452 // In other cases (aside from the nullable cases above), 3453 // a proto3 scalar field is populated if it contains a non-zero value, and 3454 // a repeated field is populated if it is non-empty. 3455 func (x *fastReflection_TableModel) Has(fd protoreflect.FieldDescriptor) bool { 3456 switch fd.FullName() { 3457 case "testpb.TableModel.id": 3458 return x.Id != uint64(0) 3459 case "testpb.TableModel.name": 3460 return x.Name != "" 3461 case "testpb.TableModel.number": 3462 return x.Number != uint64(0) 3463 case "testpb.TableModel.metadata": 3464 return len(x.Metadata) != 0 3465 default: 3466 if fd.IsExtension() { 3467 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.TableModel")) 3468 } 3469 panic(fmt.Errorf("message testpb.TableModel does not contain field %s", fd.FullName())) 3470 } 3471 } 3472 3473 // Clear clears the field such that a subsequent Has call reports false. 3474 // 3475 // Clearing an extension field clears both the extension type and value 3476 // associated with the given field number. 3477 // 3478 // Clear is a mutating operation and unsafe for concurrent use. 3479 func (x *fastReflection_TableModel) Clear(fd protoreflect.FieldDescriptor) { 3480 switch fd.FullName() { 3481 case "testpb.TableModel.id": 3482 x.Id = uint64(0) 3483 case "testpb.TableModel.name": 3484 x.Name = "" 3485 case "testpb.TableModel.number": 3486 x.Number = uint64(0) 3487 case "testpb.TableModel.metadata": 3488 x.Metadata = nil 3489 default: 3490 if fd.IsExtension() { 3491 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.TableModel")) 3492 } 3493 panic(fmt.Errorf("message testpb.TableModel does not contain field %s", fd.FullName())) 3494 } 3495 } 3496 3497 // Get retrieves the value for a field. 3498 // 3499 // For unpopulated scalars, it returns the default value, where 3500 // the default value of a bytes scalar is guaranteed to be a copy. 3501 // For unpopulated composite types, it returns an empty, read-only view 3502 // of the value; to obtain a mutable reference, use Mutable. 3503 func (x *fastReflection_TableModel) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { 3504 switch descriptor.FullName() { 3505 case "testpb.TableModel.id": 3506 value := x.Id 3507 return protoreflect.ValueOfUint64(value) 3508 case "testpb.TableModel.name": 3509 value := x.Name 3510 return protoreflect.ValueOfString(value) 3511 case "testpb.TableModel.number": 3512 value := x.Number 3513 return protoreflect.ValueOfUint64(value) 3514 case "testpb.TableModel.metadata": 3515 value := x.Metadata 3516 return protoreflect.ValueOfBytes(value) 3517 default: 3518 if descriptor.IsExtension() { 3519 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.TableModel")) 3520 } 3521 panic(fmt.Errorf("message testpb.TableModel does not contain field %s", descriptor.FullName())) 3522 } 3523 } 3524 3525 // Set stores the value for a field. 3526 // 3527 // For a field belonging to a oneof, it implicitly clears any other field 3528 // that may be currently set within the same oneof. 3529 // For extension fields, it implicitly stores the provided ExtensionType. 3530 // When setting a composite type, it is unspecified whether the stored value 3531 // aliases the source's memory in any way. If the composite value is an 3532 // empty, read-only value, then it panics. 3533 // 3534 // Set is a mutating operation and unsafe for concurrent use. 3535 func (x *fastReflection_TableModel) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { 3536 switch fd.FullName() { 3537 case "testpb.TableModel.id": 3538 x.Id = value.Uint() 3539 case "testpb.TableModel.name": 3540 x.Name = value.Interface().(string) 3541 case "testpb.TableModel.number": 3542 x.Number = value.Uint() 3543 case "testpb.TableModel.metadata": 3544 x.Metadata = value.Bytes() 3545 default: 3546 if fd.IsExtension() { 3547 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.TableModel")) 3548 } 3549 panic(fmt.Errorf("message testpb.TableModel does not contain field %s", fd.FullName())) 3550 } 3551 } 3552 3553 // Mutable returns a mutable reference to a composite type. 3554 // 3555 // If the field is unpopulated, it may allocate a composite value. 3556 // For a field belonging to a oneof, it implicitly clears any other field 3557 // that may be currently set within the same oneof. 3558 // For extension fields, it implicitly stores the provided ExtensionType 3559 // if not already stored. 3560 // It panics if the field does not contain a composite type. 3561 // 3562 // Mutable is a mutating operation and unsafe for concurrent use. 3563 func (x *fastReflection_TableModel) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { 3564 switch fd.FullName() { 3565 case "testpb.TableModel.id": 3566 panic(fmt.Errorf("field id of message testpb.TableModel is not mutable")) 3567 case "testpb.TableModel.name": 3568 panic(fmt.Errorf("field name of message testpb.TableModel is not mutable")) 3569 case "testpb.TableModel.number": 3570 panic(fmt.Errorf("field number of message testpb.TableModel is not mutable")) 3571 case "testpb.TableModel.metadata": 3572 panic(fmt.Errorf("field metadata of message testpb.TableModel is not mutable")) 3573 default: 3574 if fd.IsExtension() { 3575 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.TableModel")) 3576 } 3577 panic(fmt.Errorf("message testpb.TableModel does not contain field %s", fd.FullName())) 3578 } 3579 } 3580 3581 // NewField returns a new value that is assignable to the field 3582 // for the given descriptor. For scalars, this returns the default value. 3583 // For lists, maps, and messages, this returns a new, empty, mutable value. 3584 func (x *fastReflection_TableModel) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { 3585 switch fd.FullName() { 3586 case "testpb.TableModel.id": 3587 return protoreflect.ValueOfUint64(uint64(0)) 3588 case "testpb.TableModel.name": 3589 return protoreflect.ValueOfString("") 3590 case "testpb.TableModel.number": 3591 return protoreflect.ValueOfUint64(uint64(0)) 3592 case "testpb.TableModel.metadata": 3593 return protoreflect.ValueOfBytes(nil) 3594 default: 3595 if fd.IsExtension() { 3596 panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.TableModel")) 3597 } 3598 panic(fmt.Errorf("message testpb.TableModel does not contain field %s", fd.FullName())) 3599 } 3600 } 3601 3602 // WhichOneof reports which field within the oneof is populated, 3603 // returning nil if none are populated. 3604 // It panics if the oneof descriptor does not belong to this message. 3605 func (x *fastReflection_TableModel) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { 3606 switch d.FullName() { 3607 default: 3608 panic(fmt.Errorf("%s is not a oneof field in testpb.TableModel", d.FullName())) 3609 } 3610 panic("unreachable") 3611 } 3612 3613 // GetUnknown retrieves the entire list of unknown fields. 3614 // The caller may only mutate the contents of the RawFields 3615 // if the mutated bytes are stored back into the message with SetUnknown. 3616 func (x *fastReflection_TableModel) GetUnknown() protoreflect.RawFields { 3617 return x.unknownFields 3618 } 3619 3620 // SetUnknown stores an entire list of unknown fields. 3621 // The raw fields must be syntactically valid according to the wire format. 3622 // An implementation may panic if this is not the case. 3623 // Once stored, the caller must not mutate the content of the RawFields. 3624 // An empty RawFields may be passed to clear the fields. 3625 // 3626 // SetUnknown is a mutating operation and unsafe for concurrent use. 3627 func (x *fastReflection_TableModel) SetUnknown(fields protoreflect.RawFields) { 3628 x.unknownFields = fields 3629 } 3630 3631 // IsValid reports whether the message is valid. 3632 // 3633 // An invalid message is an empty, read-only value. 3634 // 3635 // An invalid message often corresponds to a nil pointer of the concrete 3636 // message type, but the details are implementation dependent. 3637 // Validity is not part of the protobuf data model, and may not 3638 // be preserved in marshaling or other operations. 3639 func (x *fastReflection_TableModel) IsValid() bool { 3640 return x != nil 3641 } 3642 3643 // ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. 3644 // This method may return nil. 3645 // 3646 // The returned methods type is identical to 3647 // "google.golang.org/protobuf/runtime/protoiface".Methods. 3648 // Consult the protoiface package documentation for details. 3649 func (x *fastReflection_TableModel) ProtoMethods() *protoiface.Methods { 3650 size := func(input protoiface.SizeInput) protoiface.SizeOutput { 3651 x := input.Message.Interface().(*TableModel) 3652 if x == nil { 3653 return protoiface.SizeOutput{ 3654 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3655 Size: 0, 3656 } 3657 } 3658 options := runtime.SizeInputToOptions(input) 3659 _ = options 3660 var n int 3661 var l int 3662 _ = l 3663 if x.Id != 0 { 3664 n += 1 + runtime.Sov(uint64(x.Id)) 3665 } 3666 l = len(x.Name) 3667 if l > 0 { 3668 n += 1 + l + runtime.Sov(uint64(l)) 3669 } 3670 if x.Number != 0 { 3671 n += 1 + runtime.Sov(uint64(x.Number)) 3672 } 3673 l = len(x.Metadata) 3674 if l > 0 { 3675 n += 1 + l + runtime.Sov(uint64(l)) 3676 } 3677 if x.unknownFields != nil { 3678 n += len(x.unknownFields) 3679 } 3680 return protoiface.SizeOutput{ 3681 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3682 Size: n, 3683 } 3684 } 3685 3686 marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { 3687 x := input.Message.Interface().(*TableModel) 3688 if x == nil { 3689 return protoiface.MarshalOutput{ 3690 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3691 Buf: input.Buf, 3692 }, nil 3693 } 3694 options := runtime.MarshalInputToOptions(input) 3695 _ = options 3696 size := options.Size(x) 3697 dAtA := make([]byte, size) 3698 i := len(dAtA) 3699 _ = i 3700 var l int 3701 _ = l 3702 if x.unknownFields != nil { 3703 i -= len(x.unknownFields) 3704 copy(dAtA[i:], x.unknownFields) 3705 } 3706 if len(x.Metadata) > 0 { 3707 i -= len(x.Metadata) 3708 copy(dAtA[i:], x.Metadata) 3709 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata))) 3710 i-- 3711 dAtA[i] = 0x22 3712 } 3713 if x.Number != 0 { 3714 i = runtime.EncodeVarint(dAtA, i, uint64(x.Number)) 3715 i-- 3716 dAtA[i] = 0x18 3717 } 3718 if len(x.Name) > 0 { 3719 i -= len(x.Name) 3720 copy(dAtA[i:], x.Name) 3721 i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) 3722 i-- 3723 dAtA[i] = 0x12 3724 } 3725 if x.Id != 0 { 3726 i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) 3727 i-- 3728 dAtA[i] = 0x8 3729 } 3730 if input.Buf != nil { 3731 input.Buf = append(input.Buf, dAtA...) 3732 } else { 3733 input.Buf = dAtA 3734 } 3735 return protoiface.MarshalOutput{ 3736 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3737 Buf: input.Buf, 3738 }, nil 3739 } 3740 unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { 3741 x := input.Message.Interface().(*TableModel) 3742 if x == nil { 3743 return protoiface.UnmarshalOutput{ 3744 NoUnkeyedLiterals: input.NoUnkeyedLiterals, 3745 Flags: input.Flags, 3746 }, nil 3747 } 3748 options := runtime.UnmarshalInputToOptions(input) 3749 _ = options 3750 dAtA := input.Buf 3751 l := len(dAtA) 3752 iNdEx := 0 3753 for iNdEx < l { 3754 preIndex := iNdEx 3755 var wire uint64 3756 for shift := uint(0); ; shift += 7 { 3757 if shift >= 64 { 3758 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3759 } 3760 if iNdEx >= l { 3761 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3762 } 3763 b := dAtA[iNdEx] 3764 iNdEx++ 3765 wire |= uint64(b&0x7F) << shift 3766 if b < 0x80 { 3767 break 3768 } 3769 } 3770 fieldNum := int32(wire >> 3) 3771 wireType := int(wire & 0x7) 3772 if wireType == 4 { 3773 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TableModel: wiretype end group for non-group") 3774 } 3775 if fieldNum <= 0 { 3776 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TableModel: illegal tag %d (wire type %d)", fieldNum, wire) 3777 } 3778 switch fieldNum { 3779 case 1: 3780 if wireType != 0 { 3781 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) 3782 } 3783 x.Id = 0 3784 for shift := uint(0); ; shift += 7 { 3785 if shift >= 64 { 3786 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3787 } 3788 if iNdEx >= l { 3789 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3790 } 3791 b := dAtA[iNdEx] 3792 iNdEx++ 3793 x.Id |= uint64(b&0x7F) << shift 3794 if b < 0x80 { 3795 break 3796 } 3797 } 3798 case 2: 3799 if wireType != 2 { 3800 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 3801 } 3802 var stringLen uint64 3803 for shift := uint(0); ; shift += 7 { 3804 if shift >= 64 { 3805 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3806 } 3807 if iNdEx >= l { 3808 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3809 } 3810 b := dAtA[iNdEx] 3811 iNdEx++ 3812 stringLen |= uint64(b&0x7F) << shift 3813 if b < 0x80 { 3814 break 3815 } 3816 } 3817 intStringLen := int(stringLen) 3818 if intStringLen < 0 { 3819 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3820 } 3821 postIndex := iNdEx + intStringLen 3822 if postIndex < 0 { 3823 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3824 } 3825 if postIndex > l { 3826 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3827 } 3828 x.Name = string(dAtA[iNdEx:postIndex]) 3829 iNdEx = postIndex 3830 case 3: 3831 if wireType != 0 { 3832 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) 3833 } 3834 x.Number = 0 3835 for shift := uint(0); ; shift += 7 { 3836 if shift >= 64 { 3837 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3838 } 3839 if iNdEx >= l { 3840 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3841 } 3842 b := dAtA[iNdEx] 3843 iNdEx++ 3844 x.Number |= uint64(b&0x7F) << shift 3845 if b < 0x80 { 3846 break 3847 } 3848 } 3849 case 4: 3850 if wireType != 2 { 3851 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) 3852 } 3853 var byteLen int 3854 for shift := uint(0); ; shift += 7 { 3855 if shift >= 64 { 3856 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow 3857 } 3858 if iNdEx >= l { 3859 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3860 } 3861 b := dAtA[iNdEx] 3862 iNdEx++ 3863 byteLen |= int(b&0x7F) << shift 3864 if b < 0x80 { 3865 break 3866 } 3867 } 3868 if byteLen < 0 { 3869 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3870 } 3871 postIndex := iNdEx + byteLen 3872 if postIndex < 0 { 3873 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3874 } 3875 if postIndex > l { 3876 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3877 } 3878 x.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) 3879 if x.Metadata == nil { 3880 x.Metadata = []byte{} 3881 } 3882 iNdEx = postIndex 3883 default: 3884 iNdEx = preIndex 3885 skippy, err := runtime.Skip(dAtA[iNdEx:]) 3886 if err != nil { 3887 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err 3888 } 3889 if (skippy < 0) || (iNdEx+skippy) < 0 { 3890 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength 3891 } 3892 if (iNdEx + skippy) > l { 3893 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3894 } 3895 if !options.DiscardUnknown { 3896 x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 3897 } 3898 iNdEx += skippy 3899 } 3900 } 3901 3902 if iNdEx > l { 3903 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF 3904 } 3905 return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil 3906 } 3907 return &protoiface.Methods{ 3908 NoUnkeyedLiterals: struct{}{}, 3909 Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, 3910 Size: size, 3911 Marshal: marshal, 3912 Unmarshal: unmarshal, 3913 Merge: nil, 3914 CheckInitialized: nil, 3915 } 3916 } 3917 3918 // Code generated by protoc-gen-go. DO NOT EDIT. 3919 // versions: 3920 // protoc-gen-go v1.27.0 3921 // protoc (unknown) 3922 // source: testpb/testdata.proto 3923 3924 const ( 3925 // Verify that this generated code is sufficiently up-to-date. 3926 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 3927 // Verify that runtime/protoimpl is sufficiently up-to-date. 3928 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 3929 ) 3930 3931 type Dog struct { 3932 state protoimpl.MessageState 3933 sizeCache protoimpl.SizeCache 3934 unknownFields protoimpl.UnknownFields 3935 3936 Size string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` 3937 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` 3938 } 3939 3940 func (x *Dog) Reset() { 3941 *x = Dog{} 3942 if protoimpl.UnsafeEnabled { 3943 mi := &file_testpb_testdata_proto_msgTypes[0] 3944 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 3945 ms.StoreMessageInfo(mi) 3946 } 3947 } 3948 3949 func (x *Dog) String() string { 3950 return protoimpl.X.MessageStringOf(x) 3951 } 3952 3953 func (*Dog) ProtoMessage() {} 3954 3955 // Deprecated: Use Dog.ProtoReflect.Descriptor instead. 3956 func (*Dog) Descriptor() ([]byte, []int) { 3957 return file_testpb_testdata_proto_rawDescGZIP(), []int{0} 3958 } 3959 3960 func (x *Dog) GetSize() string { 3961 if x != nil { 3962 return x.Size 3963 } 3964 return "" 3965 } 3966 3967 func (x *Dog) GetName() string { 3968 if x != nil { 3969 return x.Name 3970 } 3971 return "" 3972 } 3973 3974 type Cat struct { 3975 state protoimpl.MessageState 3976 sizeCache protoimpl.SizeCache 3977 unknownFields protoimpl.UnknownFields 3978 3979 Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` 3980 Lives int32 `protobuf:"varint,2,opt,name=lives,proto3" json:"lives,omitempty"` 3981 } 3982 3983 func (x *Cat) Reset() { 3984 *x = Cat{} 3985 if protoimpl.UnsafeEnabled { 3986 mi := &file_testpb_testdata_proto_msgTypes[1] 3987 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 3988 ms.StoreMessageInfo(mi) 3989 } 3990 } 3991 3992 func (x *Cat) String() string { 3993 return protoimpl.X.MessageStringOf(x) 3994 } 3995 3996 func (*Cat) ProtoMessage() {} 3997 3998 // Deprecated: Use Cat.ProtoReflect.Descriptor instead. 3999 func (*Cat) Descriptor() ([]byte, []int) { 4000 return file_testpb_testdata_proto_rawDescGZIP(), []int{1} 4001 } 4002 4003 func (x *Cat) GetMoniker() string { 4004 if x != nil { 4005 return x.Moniker 4006 } 4007 return "" 4008 } 4009 4010 func (x *Cat) GetLives() int32 { 4011 if x != nil { 4012 return x.Lives 4013 } 4014 return 0 4015 } 4016 4017 type Bird struct { 4018 state protoimpl.MessageState 4019 sizeCache protoimpl.SizeCache 4020 unknownFields protoimpl.UnknownFields 4021 4022 Species string `protobuf:"bytes,1,opt,name=species,proto3" json:"species,omitempty"` 4023 Color int32 `protobuf:"varint,2,opt,name=color,proto3" json:"color,omitempty"` 4024 } 4025 4026 func (x *Bird) Reset() { 4027 *x = Bird{} 4028 if protoimpl.UnsafeEnabled { 4029 mi := &file_testpb_testdata_proto_msgTypes[2] 4030 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 4031 ms.StoreMessageInfo(mi) 4032 } 4033 } 4034 4035 func (x *Bird) String() string { 4036 return protoimpl.X.MessageStringOf(x) 4037 } 4038 4039 func (*Bird) ProtoMessage() {} 4040 4041 // Deprecated: Use Bird.ProtoReflect.Descriptor instead. 4042 func (*Bird) Descriptor() ([]byte, []int) { 4043 return file_testpb_testdata_proto_rawDescGZIP(), []int{2} 4044 } 4045 4046 func (x *Bird) GetSpecies() string { 4047 if x != nil { 4048 return x.Species 4049 } 4050 return "" 4051 } 4052 4053 func (x *Bird) GetColor() int32 { 4054 if x != nil { 4055 return x.Color 4056 } 4057 return 0 4058 } 4059 4060 type HasAnimal struct { 4061 state protoimpl.MessageState 4062 sizeCache protoimpl.SizeCache 4063 unknownFields protoimpl.UnknownFields 4064 4065 Animal *anypb.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` 4066 X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` 4067 } 4068 4069 func (x *HasAnimal) Reset() { 4070 *x = HasAnimal{} 4071 if protoimpl.UnsafeEnabled { 4072 mi := &file_testpb_testdata_proto_msgTypes[3] 4073 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 4074 ms.StoreMessageInfo(mi) 4075 } 4076 } 4077 4078 func (x *HasAnimal) String() string { 4079 return protoimpl.X.MessageStringOf(x) 4080 } 4081 4082 func (*HasAnimal) ProtoMessage() {} 4083 4084 // Deprecated: Use HasAnimal.ProtoReflect.Descriptor instead. 4085 func (*HasAnimal) Descriptor() ([]byte, []int) { 4086 return file_testpb_testdata_proto_rawDescGZIP(), []int{3} 4087 } 4088 4089 func (x *HasAnimal) GetAnimal() *anypb.Any { 4090 if x != nil { 4091 return x.Animal 4092 } 4093 return nil 4094 } 4095 4096 func (x *HasAnimal) GetX() int64 { 4097 if x != nil { 4098 return x.X 4099 } 4100 return 0 4101 } 4102 4103 type HasHasAnimal struct { 4104 state protoimpl.MessageState 4105 sizeCache protoimpl.SizeCache 4106 unknownFields protoimpl.UnknownFields 4107 4108 HasAnimal *anypb.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` 4109 } 4110 4111 func (x *HasHasAnimal) Reset() { 4112 *x = HasHasAnimal{} 4113 if protoimpl.UnsafeEnabled { 4114 mi := &file_testpb_testdata_proto_msgTypes[4] 4115 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 4116 ms.StoreMessageInfo(mi) 4117 } 4118 } 4119 4120 func (x *HasHasAnimal) String() string { 4121 return protoimpl.X.MessageStringOf(x) 4122 } 4123 4124 func (*HasHasAnimal) ProtoMessage() {} 4125 4126 // Deprecated: Use HasHasAnimal.ProtoReflect.Descriptor instead. 4127 func (*HasHasAnimal) Descriptor() ([]byte, []int) { 4128 return file_testpb_testdata_proto_rawDescGZIP(), []int{4} 4129 } 4130 4131 func (x *HasHasAnimal) GetHasAnimal() *anypb.Any { 4132 if x != nil { 4133 return x.HasAnimal 4134 } 4135 return nil 4136 } 4137 4138 type HasHasHasAnimal struct { 4139 state protoimpl.MessageState 4140 sizeCache protoimpl.SizeCache 4141 unknownFields protoimpl.UnknownFields 4142 4143 HasHasAnimal *anypb.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` 4144 } 4145 4146 func (x *HasHasHasAnimal) Reset() { 4147 *x = HasHasHasAnimal{} 4148 if protoimpl.UnsafeEnabled { 4149 mi := &file_testpb_testdata_proto_msgTypes[5] 4150 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 4151 ms.StoreMessageInfo(mi) 4152 } 4153 } 4154 4155 func (x *HasHasHasAnimal) String() string { 4156 return protoimpl.X.MessageStringOf(x) 4157 } 4158 4159 func (*HasHasHasAnimal) ProtoMessage() {} 4160 4161 // Deprecated: Use HasHasHasAnimal.ProtoReflect.Descriptor instead. 4162 func (*HasHasHasAnimal) Descriptor() ([]byte, []int) { 4163 return file_testpb_testdata_proto_rawDescGZIP(), []int{5} 4164 } 4165 4166 func (x *HasHasHasAnimal) GetHasHasAnimal() *anypb.Any { 4167 if x != nil { 4168 return x.HasHasAnimal 4169 } 4170 return nil 4171 } 4172 4173 // bad MultiSignature with extra fields 4174 type BadMultiSignature struct { 4175 state protoimpl.MessageState 4176 sizeCache protoimpl.SizeCache 4177 unknownFields protoimpl.UnknownFields 4178 4179 Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` 4180 MaliciousField []byte `protobuf:"bytes,5,opt,name=malicious_field,json=maliciousField,proto3" json:"malicious_field,omitempty"` 4181 } 4182 4183 func (x *BadMultiSignature) Reset() { 4184 *x = BadMultiSignature{} 4185 if protoimpl.UnsafeEnabled { 4186 mi := &file_testpb_testdata_proto_msgTypes[6] 4187 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 4188 ms.StoreMessageInfo(mi) 4189 } 4190 } 4191 4192 func (x *BadMultiSignature) String() string { 4193 return protoimpl.X.MessageStringOf(x) 4194 } 4195 4196 func (*BadMultiSignature) ProtoMessage() {} 4197 4198 // Deprecated: Use BadMultiSignature.ProtoReflect.Descriptor instead. 4199 func (*BadMultiSignature) Descriptor() ([]byte, []int) { 4200 return file_testpb_testdata_proto_rawDescGZIP(), []int{6} 4201 } 4202 4203 func (x *BadMultiSignature) GetSignatures() [][]byte { 4204 if x != nil { 4205 return x.Signatures 4206 } 4207 return nil 4208 } 4209 4210 func (x *BadMultiSignature) GetMaliciousField() []byte { 4211 if x != nil { 4212 return x.MaliciousField 4213 } 4214 return nil 4215 } 4216 4217 type TableModel struct { 4218 state protoimpl.MessageState 4219 sizeCache protoimpl.SizeCache 4220 unknownFields protoimpl.UnknownFields 4221 4222 Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` 4223 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` 4224 Number uint64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` 4225 Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` 4226 } 4227 4228 func (x *TableModel) Reset() { 4229 *x = TableModel{} 4230 if protoimpl.UnsafeEnabled { 4231 mi := &file_testpb_testdata_proto_msgTypes[7] 4232 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 4233 ms.StoreMessageInfo(mi) 4234 } 4235 } 4236 4237 func (x *TableModel) String() string { 4238 return protoimpl.X.MessageStringOf(x) 4239 } 4240 4241 func (*TableModel) ProtoMessage() {} 4242 4243 // Deprecated: Use TableModel.ProtoReflect.Descriptor instead. 4244 func (*TableModel) Descriptor() ([]byte, []int) { 4245 return file_testpb_testdata_proto_rawDescGZIP(), []int{7} 4246 } 4247 4248 func (x *TableModel) GetId() uint64 { 4249 if x != nil { 4250 return x.Id 4251 } 4252 return 0 4253 } 4254 4255 func (x *TableModel) GetName() string { 4256 if x != nil { 4257 return x.Name 4258 } 4259 return "" 4260 } 4261 4262 func (x *TableModel) GetNumber() uint64 { 4263 if x != nil { 4264 return x.Number 4265 } 4266 return 0 4267 } 4268 4269 func (x *TableModel) GetMetadata() []byte { 4270 if x != nil { 4271 return x.Metadata 4272 } 4273 return nil 4274 } 4275 4276 var File_testpb_testdata_proto protoreflect.FileDescriptor 4277 4278 var file_testpb_testdata_proto_rawDesc = []byte{ 4279 0x0a, 0x15, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 4280 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x1a, 4281 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 4282 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 4283 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 4284 0x22, 0x2d, 0x0a, 0x03, 0x44, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 4285 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 4286 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 4287 0x35, 0x0a, 0x03, 0x43, 0x61, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 4288 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 4289 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x76, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 4290 0x05, 0x6c, 0x69, 0x76, 0x65, 0x73, 0x22, 0x36, 0x0a, 0x04, 0x42, 0x69, 0x72, 0x64, 0x12, 0x18, 4291 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 4292 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 4293 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x47, 4294 0x0a, 0x09, 0x48, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x2c, 0x0a, 0x06, 0x61, 4295 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 4296 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 4297 0x79, 0x52, 0x06, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x02, 4298 0x20, 0x01, 0x28, 0x03, 0x52, 0x01, 0x78, 0x22, 0x43, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x48, 0x61, 4299 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x33, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x5f, 0x61, 4300 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 4301 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 4302 0x79, 0x52, 0x09, 0x68, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x22, 0x4d, 0x0a, 0x0f, 4303 0x48, 0x61, 0x73, 0x48, 0x61, 0x73, 0x48, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 4304 0x3a, 0x0a, 0x0e, 0x68, 0x61, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x6e, 0x69, 0x6d, 0x61, 4305 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 4306 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0c, 0x68, 4307 0x61, 0x73, 0x48, 0x61, 0x73, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x22, 0x62, 0x0a, 0x11, 0x42, 4308 0x61, 0x64, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 4309 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 4310 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 4311 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x6c, 0x69, 0x63, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x66, 0x69, 4312 0x65, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6d, 0x61, 0x6c, 0x69, 0x63, 4313 0x69, 0x6f, 0x75, 0x73, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x04, 0xd0, 0xa1, 0x1f, 0x01, 0x22, 4314 0x64, 0x0a, 0x0a, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 4315 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 4316 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 4317 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 4318 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 4319 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 4320 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x91, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 4321 0x73, 0x74, 0x70, 0x62, 0x42, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x50, 0x72, 4322 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 4323 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 4324 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x74, 0x65, 0x73, 4325 0x74, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x75, 0x6c, 0x73, 0x61, 0x72, 0x2f, 0x74, 0x65, 0x73, 4326 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 4327 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 4328 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 4329 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 4330 0x33, 4331 } 4332 4333 var ( 4334 file_testpb_testdata_proto_rawDescOnce sync.Once 4335 file_testpb_testdata_proto_rawDescData = file_testpb_testdata_proto_rawDesc 4336 ) 4337 4338 func file_testpb_testdata_proto_rawDescGZIP() []byte { 4339 file_testpb_testdata_proto_rawDescOnce.Do(func() { 4340 file_testpb_testdata_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_testdata_proto_rawDescData) 4341 }) 4342 return file_testpb_testdata_proto_rawDescData 4343 } 4344 4345 var file_testpb_testdata_proto_msgTypes = make([]protoimpl.MessageInfo, 8) 4346 var file_testpb_testdata_proto_goTypes = []interface{}{ 4347 (*Dog)(nil), // 0: testpb.Dog 4348 (*Cat)(nil), // 1: testpb.Cat 4349 (*Bird)(nil), // 2: testpb.Bird 4350 (*HasAnimal)(nil), // 3: testpb.HasAnimal 4351 (*HasHasAnimal)(nil), // 4: testpb.HasHasAnimal 4352 (*HasHasHasAnimal)(nil), // 5: testpb.HasHasHasAnimal 4353 (*BadMultiSignature)(nil), // 6: testpb.BadMultiSignature 4354 (*TableModel)(nil), // 7: testpb.TableModel 4355 (*anypb.Any)(nil), // 8: google.protobuf.Any 4356 } 4357 var file_testpb_testdata_proto_depIdxs = []int32{ 4358 8, // 0: testpb.HasAnimal.animal:type_name -> google.protobuf.Any 4359 8, // 1: testpb.HasHasAnimal.has_animal:type_name -> google.protobuf.Any 4360 8, // 2: testpb.HasHasHasAnimal.has_has_animal:type_name -> google.protobuf.Any 4361 3, // [3:3] is the sub-list for method output_type 4362 3, // [3:3] is the sub-list for method input_type 4363 3, // [3:3] is the sub-list for extension type_name 4364 3, // [3:3] is the sub-list for extension extendee 4365 0, // [0:3] is the sub-list for field type_name 4366 } 4367 4368 func init() { file_testpb_testdata_proto_init() } 4369 func file_testpb_testdata_proto_init() { 4370 if File_testpb_testdata_proto != nil { 4371 return 4372 } 4373 if !protoimpl.UnsafeEnabled { 4374 file_testpb_testdata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 4375 switch v := v.(*Dog); i { 4376 case 0: 4377 return &v.state 4378 case 1: 4379 return &v.sizeCache 4380 case 2: 4381 return &v.unknownFields 4382 default: 4383 return nil 4384 } 4385 } 4386 file_testpb_testdata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 4387 switch v := v.(*Cat); i { 4388 case 0: 4389 return &v.state 4390 case 1: 4391 return &v.sizeCache 4392 case 2: 4393 return &v.unknownFields 4394 default: 4395 return nil 4396 } 4397 } 4398 file_testpb_testdata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 4399 switch v := v.(*Bird); i { 4400 case 0: 4401 return &v.state 4402 case 1: 4403 return &v.sizeCache 4404 case 2: 4405 return &v.unknownFields 4406 default: 4407 return nil 4408 } 4409 } 4410 file_testpb_testdata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 4411 switch v := v.(*HasAnimal); i { 4412 case 0: 4413 return &v.state 4414 case 1: 4415 return &v.sizeCache 4416 case 2: 4417 return &v.unknownFields 4418 default: 4419 return nil 4420 } 4421 } 4422 file_testpb_testdata_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { 4423 switch v := v.(*HasHasAnimal); i { 4424 case 0: 4425 return &v.state 4426 case 1: 4427 return &v.sizeCache 4428 case 2: 4429 return &v.unknownFields 4430 default: 4431 return nil 4432 } 4433 } 4434 file_testpb_testdata_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { 4435 switch v := v.(*HasHasHasAnimal); i { 4436 case 0: 4437 return &v.state 4438 case 1: 4439 return &v.sizeCache 4440 case 2: 4441 return &v.unknownFields 4442 default: 4443 return nil 4444 } 4445 } 4446 file_testpb_testdata_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { 4447 switch v := v.(*BadMultiSignature); i { 4448 case 0: 4449 return &v.state 4450 case 1: 4451 return &v.sizeCache 4452 case 2: 4453 return &v.unknownFields 4454 default: 4455 return nil 4456 } 4457 } 4458 file_testpb_testdata_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { 4459 switch v := v.(*TableModel); i { 4460 case 0: 4461 return &v.state 4462 case 1: 4463 return &v.sizeCache 4464 case 2: 4465 return &v.unknownFields 4466 default: 4467 return nil 4468 } 4469 } 4470 } 4471 type x struct{} 4472 out := protoimpl.TypeBuilder{ 4473 File: protoimpl.DescBuilder{ 4474 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 4475 RawDescriptor: file_testpb_testdata_proto_rawDesc, 4476 NumEnums: 0, 4477 NumMessages: 8, 4478 NumExtensions: 0, 4479 NumServices: 0, 4480 }, 4481 GoTypes: file_testpb_testdata_proto_goTypes, 4482 DependencyIndexes: file_testpb_testdata_proto_depIdxs, 4483 MessageInfos: file_testpb_testdata_proto_msgTypes, 4484 }.Build() 4485 File_testpb_testdata_proto = out.File 4486 file_testpb_testdata_proto_rawDesc = nil 4487 file_testpb_testdata_proto_goTypes = nil 4488 file_testpb_testdata_proto_depIdxs = nil 4489 }