github.com/fananchong/cstruct-go@v0.0.0-20220616060855-b65d9a2f2e17/benchmarks/myproto2.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: myproto2.proto 3 4 /* 5 Package benchmarks is a generated protocol buffer package. 6 7 It is generated from these files: 8 myproto2.proto 9 10 It has these top-level messages: 11 Myproto4 12 Myproto3 13 */ 14 package benchmarks 15 16 import proto "github.com/gogo/protobuf/proto" 17 import fmt "fmt" 18 import math "math" 19 20 import io "io" 21 22 // Reference imports to suppress errors if they are not otherwise used. 23 var _ = proto.Marshal 24 var _ = fmt.Errorf 25 var _ = math.Inf 26 27 // This is a compile-time assertion to ensure that this generated file 28 // is compatible with the proto package it is being compiled against. 29 // A compilation error at this line likely means your copy of the 30 // proto package needs to be updated. 31 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 32 33 type Myproto4 struct { 34 F3 float64 `protobuf:"fixed64,3,opt,name=F3,proto3" json:"F3,omitempty"` 35 F4 string `protobuf:"bytes,4,opt,name=F4,proto3" json:"F4,omitempty"` 36 } 37 38 func (m *Myproto4) Reset() { *m = Myproto4{} } 39 func (m *Myproto4) String() string { return proto.CompactTextString(m) } 40 func (*Myproto4) ProtoMessage() {} 41 func (*Myproto4) Descriptor() ([]byte, []int) { return fileDescriptorMyproto2, []int{0} } 42 43 func (m *Myproto4) GetF3() float64 { 44 if m != nil { 45 return m.F3 46 } 47 return 0 48 } 49 50 func (m *Myproto4) GetF4() string { 51 if m != nil { 52 return m.F4 53 } 54 return "" 55 } 56 57 type Myproto3 struct { 58 F1 bool `protobuf:"varint,1,opt,name=F1,proto3" json:"F1,omitempty"` 59 F2 float32 `protobuf:"fixed32,2,opt,name=F2,proto3" json:"F2,omitempty"` 60 F3 float64 `protobuf:"fixed64,3,opt,name=F3,proto3" json:"F3,omitempty"` 61 F4 string `protobuf:"bytes,4,opt,name=F4,proto3" json:"F4,omitempty"` 62 F5 []byte `protobuf:"bytes,5,opt,name=F5,proto3" json:"F5,omitempty"` 63 F6 int32 `protobuf:"varint,6,opt,name=F6,proto3" json:"F6,omitempty"` 64 F7 int32 `protobuf:"varint,7,opt,name=F7,proto3" json:"F7,omitempty"` 65 F8 int32 `protobuf:"varint,8,opt,name=F8,proto3" json:"F8,omitempty"` 66 F9 int32 `protobuf:"varint,9,opt,name=F9,proto3" json:"F9,omitempty"` 67 F10 int64 `protobuf:"varint,10,opt,name=F10,proto3" json:"F10,omitempty"` 68 F11 int64 `protobuf:"varint,11,opt,name=F11,proto3" json:"F11,omitempty"` 69 F12 uint32 `protobuf:"varint,12,opt,name=F12,proto3" json:"F12,omitempty"` 70 F13 uint32 `protobuf:"varint,13,opt,name=F13,proto3" json:"F13,omitempty"` 71 F14 uint32 `protobuf:"varint,14,opt,name=F14,proto3" json:"F14,omitempty"` 72 F15 uint32 `protobuf:"varint,15,opt,name=F15,proto3" json:"F15,omitempty"` 73 F16 uint64 `protobuf:"varint,16,opt,name=F16,proto3" json:"F16,omitempty"` 74 F17 uint64 `protobuf:"varint,17,opt,name=F17,proto3" json:"F17,omitempty"` 75 S0 *Myproto4 `protobuf:"bytes,18,opt,name=S0" json:"S0,omitempty"` 76 F29 []string `protobuf:"bytes,19,rep,name=F29" json:"F29,omitempty"` 77 F30 []*Myproto4 `protobuf:"bytes,20,rep,name=F30" json:"F30,omitempty"` 78 } 79 80 func (m *Myproto3) Reset() { *m = Myproto3{} } 81 func (m *Myproto3) String() string { return proto.CompactTextString(m) } 82 func (*Myproto3) ProtoMessage() {} 83 func (*Myproto3) Descriptor() ([]byte, []int) { return fileDescriptorMyproto2, []int{1} } 84 85 func (m *Myproto3) GetF1() bool { 86 if m != nil { 87 return m.F1 88 } 89 return false 90 } 91 92 func (m *Myproto3) GetF2() float32 { 93 if m != nil { 94 return m.F2 95 } 96 return 0 97 } 98 99 func (m *Myproto3) GetF3() float64 { 100 if m != nil { 101 return m.F3 102 } 103 return 0 104 } 105 106 func (m *Myproto3) GetF4() string { 107 if m != nil { 108 return m.F4 109 } 110 return "" 111 } 112 113 func (m *Myproto3) GetF5() []byte { 114 if m != nil { 115 return m.F5 116 } 117 return nil 118 } 119 120 func (m *Myproto3) GetF6() int32 { 121 if m != nil { 122 return m.F6 123 } 124 return 0 125 } 126 127 func (m *Myproto3) GetF7() int32 { 128 if m != nil { 129 return m.F7 130 } 131 return 0 132 } 133 134 func (m *Myproto3) GetF8() int32 { 135 if m != nil { 136 return m.F8 137 } 138 return 0 139 } 140 141 func (m *Myproto3) GetF9() int32 { 142 if m != nil { 143 return m.F9 144 } 145 return 0 146 } 147 148 func (m *Myproto3) GetF10() int64 { 149 if m != nil { 150 return m.F10 151 } 152 return 0 153 } 154 155 func (m *Myproto3) GetF11() int64 { 156 if m != nil { 157 return m.F11 158 } 159 return 0 160 } 161 162 func (m *Myproto3) GetF12() uint32 { 163 if m != nil { 164 return m.F12 165 } 166 return 0 167 } 168 169 func (m *Myproto3) GetF13() uint32 { 170 if m != nil { 171 return m.F13 172 } 173 return 0 174 } 175 176 func (m *Myproto3) GetF14() uint32 { 177 if m != nil { 178 return m.F14 179 } 180 return 0 181 } 182 183 func (m *Myproto3) GetF15() uint32 { 184 if m != nil { 185 return m.F15 186 } 187 return 0 188 } 189 190 func (m *Myproto3) GetF16() uint64 { 191 if m != nil { 192 return m.F16 193 } 194 return 0 195 } 196 197 func (m *Myproto3) GetF17() uint64 { 198 if m != nil { 199 return m.F17 200 } 201 return 0 202 } 203 204 func (m *Myproto3) GetS0() *Myproto4 { 205 if m != nil { 206 return m.S0 207 } 208 return nil 209 } 210 211 func (m *Myproto3) GetF29() []string { 212 if m != nil { 213 return m.F29 214 } 215 return nil 216 } 217 218 func (m *Myproto3) GetF30() []*Myproto4 { 219 if m != nil { 220 return m.F30 221 } 222 return nil 223 } 224 225 func init() { 226 proto.RegisterType((*Myproto4)(nil), "benchmarks.Myproto4") 227 proto.RegisterType((*Myproto3)(nil), "benchmarks.Myproto3") 228 } 229 func (m *Myproto4) Marshal() (dAtA []byte, err error) { 230 size := m.Size() 231 dAtA = make([]byte, size) 232 n, err := m.MarshalTo(dAtA) 233 if err != nil { 234 return nil, err 235 } 236 return dAtA[:n], nil 237 } 238 239 func (m *Myproto4) MarshalTo(dAtA []byte) (int, error) { 240 var i int 241 _ = i 242 var l int 243 _ = l 244 if m.F3 != 0 { 245 dAtA[i] = 0x19 246 i++ 247 i = encodeFixed64Myproto2(dAtA, i, uint64(math.Float64bits(float64(m.F3)))) 248 } 249 if len(m.F4) > 0 { 250 dAtA[i] = 0x22 251 i++ 252 i = encodeVarintMyproto2(dAtA, i, uint64(len(m.F4))) 253 i += copy(dAtA[i:], m.F4) 254 } 255 return i, nil 256 } 257 258 func (m *Myproto3) Marshal() (dAtA []byte, err error) { 259 size := m.Size() 260 dAtA = make([]byte, size) 261 n, err := m.MarshalTo(dAtA) 262 if err != nil { 263 return nil, err 264 } 265 return dAtA[:n], nil 266 } 267 268 func (m *Myproto3) MarshalTo(dAtA []byte) (int, error) { 269 var i int 270 _ = i 271 var l int 272 _ = l 273 if m.F1 { 274 dAtA[i] = 0x8 275 i++ 276 if m.F1 { 277 dAtA[i] = 1 278 } else { 279 dAtA[i] = 0 280 } 281 i++ 282 } 283 if m.F2 != 0 { 284 dAtA[i] = 0x15 285 i++ 286 i = encodeFixed32Myproto2(dAtA, i, uint32(math.Float32bits(float32(m.F2)))) 287 } 288 if m.F3 != 0 { 289 dAtA[i] = 0x19 290 i++ 291 i = encodeFixed64Myproto2(dAtA, i, uint64(math.Float64bits(float64(m.F3)))) 292 } 293 if len(m.F4) > 0 { 294 dAtA[i] = 0x22 295 i++ 296 i = encodeVarintMyproto2(dAtA, i, uint64(len(m.F4))) 297 i += copy(dAtA[i:], m.F4) 298 } 299 if len(m.F5) > 0 { 300 dAtA[i] = 0x2a 301 i++ 302 i = encodeVarintMyproto2(dAtA, i, uint64(len(m.F5))) 303 i += copy(dAtA[i:], m.F5) 304 } 305 if m.F6 != 0 { 306 dAtA[i] = 0x30 307 i++ 308 i = encodeVarintMyproto2(dAtA, i, uint64(m.F6)) 309 } 310 if m.F7 != 0 { 311 dAtA[i] = 0x38 312 i++ 313 i = encodeVarintMyproto2(dAtA, i, uint64(m.F7)) 314 } 315 if m.F8 != 0 { 316 dAtA[i] = 0x40 317 i++ 318 i = encodeVarintMyproto2(dAtA, i, uint64(m.F8)) 319 } 320 if m.F9 != 0 { 321 dAtA[i] = 0x48 322 i++ 323 i = encodeVarintMyproto2(dAtA, i, uint64(m.F9)) 324 } 325 if m.F10 != 0 { 326 dAtA[i] = 0x50 327 i++ 328 i = encodeVarintMyproto2(dAtA, i, uint64(m.F10)) 329 } 330 if m.F11 != 0 { 331 dAtA[i] = 0x58 332 i++ 333 i = encodeVarintMyproto2(dAtA, i, uint64(m.F11)) 334 } 335 if m.F12 != 0 { 336 dAtA[i] = 0x60 337 i++ 338 i = encodeVarintMyproto2(dAtA, i, uint64(m.F12)) 339 } 340 if m.F13 != 0 { 341 dAtA[i] = 0x68 342 i++ 343 i = encodeVarintMyproto2(dAtA, i, uint64(m.F13)) 344 } 345 if m.F14 != 0 { 346 dAtA[i] = 0x70 347 i++ 348 i = encodeVarintMyproto2(dAtA, i, uint64(m.F14)) 349 } 350 if m.F15 != 0 { 351 dAtA[i] = 0x78 352 i++ 353 i = encodeVarintMyproto2(dAtA, i, uint64(m.F15)) 354 } 355 if m.F16 != 0 { 356 dAtA[i] = 0x80 357 i++ 358 dAtA[i] = 0x1 359 i++ 360 i = encodeVarintMyproto2(dAtA, i, uint64(m.F16)) 361 } 362 if m.F17 != 0 { 363 dAtA[i] = 0x88 364 i++ 365 dAtA[i] = 0x1 366 i++ 367 i = encodeVarintMyproto2(dAtA, i, uint64(m.F17)) 368 } 369 if m.S0 != nil { 370 dAtA[i] = 0x92 371 i++ 372 dAtA[i] = 0x1 373 i++ 374 i = encodeVarintMyproto2(dAtA, i, uint64(m.S0.Size())) 375 n1, err := m.S0.MarshalTo(dAtA[i:]) 376 if err != nil { 377 return 0, err 378 } 379 i += n1 380 } 381 if len(m.F29) > 0 { 382 for _, s := range m.F29 { 383 dAtA[i] = 0x9a 384 i++ 385 dAtA[i] = 0x1 386 i++ 387 l = len(s) 388 for l >= 1<<7 { 389 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 390 l >>= 7 391 i++ 392 } 393 dAtA[i] = uint8(l) 394 i++ 395 i += copy(dAtA[i:], s) 396 } 397 } 398 if len(m.F30) > 0 { 399 for _, msg := range m.F30 { 400 dAtA[i] = 0xa2 401 i++ 402 dAtA[i] = 0x1 403 i++ 404 i = encodeVarintMyproto2(dAtA, i, uint64(msg.Size())) 405 n, err := msg.MarshalTo(dAtA[i:]) 406 if err != nil { 407 return 0, err 408 } 409 i += n 410 } 411 } 412 return i, nil 413 } 414 415 func encodeFixed64Myproto2(dAtA []byte, offset int, v uint64) int { 416 dAtA[offset] = uint8(v) 417 dAtA[offset+1] = uint8(v >> 8) 418 dAtA[offset+2] = uint8(v >> 16) 419 dAtA[offset+3] = uint8(v >> 24) 420 dAtA[offset+4] = uint8(v >> 32) 421 dAtA[offset+5] = uint8(v >> 40) 422 dAtA[offset+6] = uint8(v >> 48) 423 dAtA[offset+7] = uint8(v >> 56) 424 return offset + 8 425 } 426 func encodeFixed32Myproto2(dAtA []byte, offset int, v uint32) int { 427 dAtA[offset] = uint8(v) 428 dAtA[offset+1] = uint8(v >> 8) 429 dAtA[offset+2] = uint8(v >> 16) 430 dAtA[offset+3] = uint8(v >> 24) 431 return offset + 4 432 } 433 func encodeVarintMyproto2(dAtA []byte, offset int, v uint64) int { 434 for v >= 1<<7 { 435 dAtA[offset] = uint8(v&0x7f | 0x80) 436 v >>= 7 437 offset++ 438 } 439 dAtA[offset] = uint8(v) 440 return offset + 1 441 } 442 func (m *Myproto4) Size() (n int) { 443 var l int 444 _ = l 445 if m.F3 != 0 { 446 n += 9 447 } 448 l = len(m.F4) 449 if l > 0 { 450 n += 1 + l + sovMyproto2(uint64(l)) 451 } 452 return n 453 } 454 455 func (m *Myproto3) Size() (n int) { 456 var l int 457 _ = l 458 if m.F1 { 459 n += 2 460 } 461 if m.F2 != 0 { 462 n += 5 463 } 464 if m.F3 != 0 { 465 n += 9 466 } 467 l = len(m.F4) 468 if l > 0 { 469 n += 1 + l + sovMyproto2(uint64(l)) 470 } 471 l = len(m.F5) 472 if l > 0 { 473 n += 1 + l + sovMyproto2(uint64(l)) 474 } 475 if m.F6 != 0 { 476 n += 1 + sovMyproto2(uint64(m.F6)) 477 } 478 if m.F7 != 0 { 479 n += 1 + sovMyproto2(uint64(m.F7)) 480 } 481 if m.F8 != 0 { 482 n += 1 + sovMyproto2(uint64(m.F8)) 483 } 484 if m.F9 != 0 { 485 n += 1 + sovMyproto2(uint64(m.F9)) 486 } 487 if m.F10 != 0 { 488 n += 1 + sovMyproto2(uint64(m.F10)) 489 } 490 if m.F11 != 0 { 491 n += 1 + sovMyproto2(uint64(m.F11)) 492 } 493 if m.F12 != 0 { 494 n += 1 + sovMyproto2(uint64(m.F12)) 495 } 496 if m.F13 != 0 { 497 n += 1 + sovMyproto2(uint64(m.F13)) 498 } 499 if m.F14 != 0 { 500 n += 1 + sovMyproto2(uint64(m.F14)) 501 } 502 if m.F15 != 0 { 503 n += 1 + sovMyproto2(uint64(m.F15)) 504 } 505 if m.F16 != 0 { 506 n += 2 + sovMyproto2(uint64(m.F16)) 507 } 508 if m.F17 != 0 { 509 n += 2 + sovMyproto2(uint64(m.F17)) 510 } 511 if m.S0 != nil { 512 l = m.S0.Size() 513 n += 2 + l + sovMyproto2(uint64(l)) 514 } 515 if len(m.F29) > 0 { 516 for _, s := range m.F29 { 517 l = len(s) 518 n += 2 + l + sovMyproto2(uint64(l)) 519 } 520 } 521 if len(m.F30) > 0 { 522 for _, e := range m.F30 { 523 l = e.Size() 524 n += 2 + l + sovMyproto2(uint64(l)) 525 } 526 } 527 return n 528 } 529 530 func sovMyproto2(x uint64) (n int) { 531 for { 532 n++ 533 x >>= 7 534 if x == 0 { 535 break 536 } 537 } 538 return n 539 } 540 func sozMyproto2(x uint64) (n int) { 541 return sovMyproto2(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 542 } 543 func (m *Myproto4) Unmarshal(dAtA []byte) error { 544 l := len(dAtA) 545 iNdEx := 0 546 for iNdEx < l { 547 preIndex := iNdEx 548 var wire uint64 549 for shift := uint(0); ; shift += 7 { 550 if shift >= 64 { 551 return ErrIntOverflowMyproto2 552 } 553 if iNdEx >= l { 554 return io.ErrUnexpectedEOF 555 } 556 b := dAtA[iNdEx] 557 iNdEx++ 558 wire |= (uint64(b) & 0x7F) << shift 559 if b < 0x80 { 560 break 561 } 562 } 563 fieldNum := int32(wire >> 3) 564 wireType := int(wire & 0x7) 565 if wireType == 4 { 566 return fmt.Errorf("proto: Myproto4: wiretype end group for non-group") 567 } 568 if fieldNum <= 0 { 569 return fmt.Errorf("proto: Myproto4: illegal tag %d (wire type %d)", fieldNum, wire) 570 } 571 switch fieldNum { 572 case 3: 573 if wireType != 1 { 574 return fmt.Errorf("proto: wrong wireType = %d for field F3", wireType) 575 } 576 var v uint64 577 if (iNdEx + 8) > l { 578 return io.ErrUnexpectedEOF 579 } 580 iNdEx += 8 581 v = uint64(dAtA[iNdEx-8]) 582 v |= uint64(dAtA[iNdEx-7]) << 8 583 v |= uint64(dAtA[iNdEx-6]) << 16 584 v |= uint64(dAtA[iNdEx-5]) << 24 585 v |= uint64(dAtA[iNdEx-4]) << 32 586 v |= uint64(dAtA[iNdEx-3]) << 40 587 v |= uint64(dAtA[iNdEx-2]) << 48 588 v |= uint64(dAtA[iNdEx-1]) << 56 589 m.F3 = float64(math.Float64frombits(v)) 590 case 4: 591 if wireType != 2 { 592 return fmt.Errorf("proto: wrong wireType = %d for field F4", wireType) 593 } 594 var stringLen uint64 595 for shift := uint(0); ; shift += 7 { 596 if shift >= 64 { 597 return ErrIntOverflowMyproto2 598 } 599 if iNdEx >= l { 600 return io.ErrUnexpectedEOF 601 } 602 b := dAtA[iNdEx] 603 iNdEx++ 604 stringLen |= (uint64(b) & 0x7F) << shift 605 if b < 0x80 { 606 break 607 } 608 } 609 intStringLen := int(stringLen) 610 if intStringLen < 0 { 611 return ErrInvalidLengthMyproto2 612 } 613 postIndex := iNdEx + intStringLen 614 if postIndex > l { 615 return io.ErrUnexpectedEOF 616 } 617 m.F4 = string(dAtA[iNdEx:postIndex]) 618 iNdEx = postIndex 619 default: 620 iNdEx = preIndex 621 skippy, err := skipMyproto2(dAtA[iNdEx:]) 622 if err != nil { 623 return err 624 } 625 if skippy < 0 { 626 return ErrInvalidLengthMyproto2 627 } 628 if (iNdEx + skippy) > l { 629 return io.ErrUnexpectedEOF 630 } 631 iNdEx += skippy 632 } 633 } 634 635 if iNdEx > l { 636 return io.ErrUnexpectedEOF 637 } 638 return nil 639 } 640 func (m *Myproto3) Unmarshal(dAtA []byte) error { 641 l := len(dAtA) 642 iNdEx := 0 643 for iNdEx < l { 644 preIndex := iNdEx 645 var wire uint64 646 for shift := uint(0); ; shift += 7 { 647 if shift >= 64 { 648 return ErrIntOverflowMyproto2 649 } 650 if iNdEx >= l { 651 return io.ErrUnexpectedEOF 652 } 653 b := dAtA[iNdEx] 654 iNdEx++ 655 wire |= (uint64(b) & 0x7F) << shift 656 if b < 0x80 { 657 break 658 } 659 } 660 fieldNum := int32(wire >> 3) 661 wireType := int(wire & 0x7) 662 if wireType == 4 { 663 return fmt.Errorf("proto: Myproto3: wiretype end group for non-group") 664 } 665 if fieldNum <= 0 { 666 return fmt.Errorf("proto: Myproto3: illegal tag %d (wire type %d)", fieldNum, wire) 667 } 668 switch fieldNum { 669 case 1: 670 if wireType != 0 { 671 return fmt.Errorf("proto: wrong wireType = %d for field F1", wireType) 672 } 673 var v int 674 for shift := uint(0); ; shift += 7 { 675 if shift >= 64 { 676 return ErrIntOverflowMyproto2 677 } 678 if iNdEx >= l { 679 return io.ErrUnexpectedEOF 680 } 681 b := dAtA[iNdEx] 682 iNdEx++ 683 v |= (int(b) & 0x7F) << shift 684 if b < 0x80 { 685 break 686 } 687 } 688 m.F1 = bool(v != 0) 689 case 2: 690 if wireType != 5 { 691 return fmt.Errorf("proto: wrong wireType = %d for field F2", wireType) 692 } 693 var v uint32 694 if (iNdEx + 4) > l { 695 return io.ErrUnexpectedEOF 696 } 697 iNdEx += 4 698 v = uint32(dAtA[iNdEx-4]) 699 v |= uint32(dAtA[iNdEx-3]) << 8 700 v |= uint32(dAtA[iNdEx-2]) << 16 701 v |= uint32(dAtA[iNdEx-1]) << 24 702 m.F2 = float32(math.Float32frombits(v)) 703 case 3: 704 if wireType != 1 { 705 return fmt.Errorf("proto: wrong wireType = %d for field F3", wireType) 706 } 707 var v uint64 708 if (iNdEx + 8) > l { 709 return io.ErrUnexpectedEOF 710 } 711 iNdEx += 8 712 v = uint64(dAtA[iNdEx-8]) 713 v |= uint64(dAtA[iNdEx-7]) << 8 714 v |= uint64(dAtA[iNdEx-6]) << 16 715 v |= uint64(dAtA[iNdEx-5]) << 24 716 v |= uint64(dAtA[iNdEx-4]) << 32 717 v |= uint64(dAtA[iNdEx-3]) << 40 718 v |= uint64(dAtA[iNdEx-2]) << 48 719 v |= uint64(dAtA[iNdEx-1]) << 56 720 m.F3 = float64(math.Float64frombits(v)) 721 case 4: 722 if wireType != 2 { 723 return fmt.Errorf("proto: wrong wireType = %d for field F4", wireType) 724 } 725 var stringLen uint64 726 for shift := uint(0); ; shift += 7 { 727 if shift >= 64 { 728 return ErrIntOverflowMyproto2 729 } 730 if iNdEx >= l { 731 return io.ErrUnexpectedEOF 732 } 733 b := dAtA[iNdEx] 734 iNdEx++ 735 stringLen |= (uint64(b) & 0x7F) << shift 736 if b < 0x80 { 737 break 738 } 739 } 740 intStringLen := int(stringLen) 741 if intStringLen < 0 { 742 return ErrInvalidLengthMyproto2 743 } 744 postIndex := iNdEx + intStringLen 745 if postIndex > l { 746 return io.ErrUnexpectedEOF 747 } 748 m.F4 = string(dAtA[iNdEx:postIndex]) 749 iNdEx = postIndex 750 case 5: 751 if wireType != 2 { 752 return fmt.Errorf("proto: wrong wireType = %d for field F5", wireType) 753 } 754 var byteLen int 755 for shift := uint(0); ; shift += 7 { 756 if shift >= 64 { 757 return ErrIntOverflowMyproto2 758 } 759 if iNdEx >= l { 760 return io.ErrUnexpectedEOF 761 } 762 b := dAtA[iNdEx] 763 iNdEx++ 764 byteLen |= (int(b) & 0x7F) << shift 765 if b < 0x80 { 766 break 767 } 768 } 769 if byteLen < 0 { 770 return ErrInvalidLengthMyproto2 771 } 772 postIndex := iNdEx + byteLen 773 if postIndex > l { 774 return io.ErrUnexpectedEOF 775 } 776 m.F5 = append(m.F5[:0], dAtA[iNdEx:postIndex]...) 777 if m.F5 == nil { 778 m.F5 = []byte{} 779 } 780 iNdEx = postIndex 781 case 6: 782 if wireType != 0 { 783 return fmt.Errorf("proto: wrong wireType = %d for field F6", wireType) 784 } 785 m.F6 = 0 786 for shift := uint(0); ; shift += 7 { 787 if shift >= 64 { 788 return ErrIntOverflowMyproto2 789 } 790 if iNdEx >= l { 791 return io.ErrUnexpectedEOF 792 } 793 b := dAtA[iNdEx] 794 iNdEx++ 795 m.F6 |= (int32(b) & 0x7F) << shift 796 if b < 0x80 { 797 break 798 } 799 } 800 case 7: 801 if wireType != 0 { 802 return fmt.Errorf("proto: wrong wireType = %d for field F7", wireType) 803 } 804 m.F7 = 0 805 for shift := uint(0); ; shift += 7 { 806 if shift >= 64 { 807 return ErrIntOverflowMyproto2 808 } 809 if iNdEx >= l { 810 return io.ErrUnexpectedEOF 811 } 812 b := dAtA[iNdEx] 813 iNdEx++ 814 m.F7 |= (int32(b) & 0x7F) << shift 815 if b < 0x80 { 816 break 817 } 818 } 819 case 8: 820 if wireType != 0 { 821 return fmt.Errorf("proto: wrong wireType = %d for field F8", wireType) 822 } 823 m.F8 = 0 824 for shift := uint(0); ; shift += 7 { 825 if shift >= 64 { 826 return ErrIntOverflowMyproto2 827 } 828 if iNdEx >= l { 829 return io.ErrUnexpectedEOF 830 } 831 b := dAtA[iNdEx] 832 iNdEx++ 833 m.F8 |= (int32(b) & 0x7F) << shift 834 if b < 0x80 { 835 break 836 } 837 } 838 case 9: 839 if wireType != 0 { 840 return fmt.Errorf("proto: wrong wireType = %d for field F9", wireType) 841 } 842 m.F9 = 0 843 for shift := uint(0); ; shift += 7 { 844 if shift >= 64 { 845 return ErrIntOverflowMyproto2 846 } 847 if iNdEx >= l { 848 return io.ErrUnexpectedEOF 849 } 850 b := dAtA[iNdEx] 851 iNdEx++ 852 m.F9 |= (int32(b) & 0x7F) << shift 853 if b < 0x80 { 854 break 855 } 856 } 857 case 10: 858 if wireType != 0 { 859 return fmt.Errorf("proto: wrong wireType = %d for field F10", wireType) 860 } 861 m.F10 = 0 862 for shift := uint(0); ; shift += 7 { 863 if shift >= 64 { 864 return ErrIntOverflowMyproto2 865 } 866 if iNdEx >= l { 867 return io.ErrUnexpectedEOF 868 } 869 b := dAtA[iNdEx] 870 iNdEx++ 871 m.F10 |= (int64(b) & 0x7F) << shift 872 if b < 0x80 { 873 break 874 } 875 } 876 case 11: 877 if wireType != 0 { 878 return fmt.Errorf("proto: wrong wireType = %d for field F11", wireType) 879 } 880 m.F11 = 0 881 for shift := uint(0); ; shift += 7 { 882 if shift >= 64 { 883 return ErrIntOverflowMyproto2 884 } 885 if iNdEx >= l { 886 return io.ErrUnexpectedEOF 887 } 888 b := dAtA[iNdEx] 889 iNdEx++ 890 m.F11 |= (int64(b) & 0x7F) << shift 891 if b < 0x80 { 892 break 893 } 894 } 895 case 12: 896 if wireType != 0 { 897 return fmt.Errorf("proto: wrong wireType = %d for field F12", wireType) 898 } 899 m.F12 = 0 900 for shift := uint(0); ; shift += 7 { 901 if shift >= 64 { 902 return ErrIntOverflowMyproto2 903 } 904 if iNdEx >= l { 905 return io.ErrUnexpectedEOF 906 } 907 b := dAtA[iNdEx] 908 iNdEx++ 909 m.F12 |= (uint32(b) & 0x7F) << shift 910 if b < 0x80 { 911 break 912 } 913 } 914 case 13: 915 if wireType != 0 { 916 return fmt.Errorf("proto: wrong wireType = %d for field F13", wireType) 917 } 918 m.F13 = 0 919 for shift := uint(0); ; shift += 7 { 920 if shift >= 64 { 921 return ErrIntOverflowMyproto2 922 } 923 if iNdEx >= l { 924 return io.ErrUnexpectedEOF 925 } 926 b := dAtA[iNdEx] 927 iNdEx++ 928 m.F13 |= (uint32(b) & 0x7F) << shift 929 if b < 0x80 { 930 break 931 } 932 } 933 case 14: 934 if wireType != 0 { 935 return fmt.Errorf("proto: wrong wireType = %d for field F14", wireType) 936 } 937 m.F14 = 0 938 for shift := uint(0); ; shift += 7 { 939 if shift >= 64 { 940 return ErrIntOverflowMyproto2 941 } 942 if iNdEx >= l { 943 return io.ErrUnexpectedEOF 944 } 945 b := dAtA[iNdEx] 946 iNdEx++ 947 m.F14 |= (uint32(b) & 0x7F) << shift 948 if b < 0x80 { 949 break 950 } 951 } 952 case 15: 953 if wireType != 0 { 954 return fmt.Errorf("proto: wrong wireType = %d for field F15", wireType) 955 } 956 m.F15 = 0 957 for shift := uint(0); ; shift += 7 { 958 if shift >= 64 { 959 return ErrIntOverflowMyproto2 960 } 961 if iNdEx >= l { 962 return io.ErrUnexpectedEOF 963 } 964 b := dAtA[iNdEx] 965 iNdEx++ 966 m.F15 |= (uint32(b) & 0x7F) << shift 967 if b < 0x80 { 968 break 969 } 970 } 971 case 16: 972 if wireType != 0 { 973 return fmt.Errorf("proto: wrong wireType = %d for field F16", wireType) 974 } 975 m.F16 = 0 976 for shift := uint(0); ; shift += 7 { 977 if shift >= 64 { 978 return ErrIntOverflowMyproto2 979 } 980 if iNdEx >= l { 981 return io.ErrUnexpectedEOF 982 } 983 b := dAtA[iNdEx] 984 iNdEx++ 985 m.F16 |= (uint64(b) & 0x7F) << shift 986 if b < 0x80 { 987 break 988 } 989 } 990 case 17: 991 if wireType != 0 { 992 return fmt.Errorf("proto: wrong wireType = %d for field F17", wireType) 993 } 994 m.F17 = 0 995 for shift := uint(0); ; shift += 7 { 996 if shift >= 64 { 997 return ErrIntOverflowMyproto2 998 } 999 if iNdEx >= l { 1000 return io.ErrUnexpectedEOF 1001 } 1002 b := dAtA[iNdEx] 1003 iNdEx++ 1004 m.F17 |= (uint64(b) & 0x7F) << shift 1005 if b < 0x80 { 1006 break 1007 } 1008 } 1009 case 18: 1010 if wireType != 2 { 1011 return fmt.Errorf("proto: wrong wireType = %d for field S0", wireType) 1012 } 1013 var msglen int 1014 for shift := uint(0); ; shift += 7 { 1015 if shift >= 64 { 1016 return ErrIntOverflowMyproto2 1017 } 1018 if iNdEx >= l { 1019 return io.ErrUnexpectedEOF 1020 } 1021 b := dAtA[iNdEx] 1022 iNdEx++ 1023 msglen |= (int(b) & 0x7F) << shift 1024 if b < 0x80 { 1025 break 1026 } 1027 } 1028 if msglen < 0 { 1029 return ErrInvalidLengthMyproto2 1030 } 1031 postIndex := iNdEx + msglen 1032 if postIndex > l { 1033 return io.ErrUnexpectedEOF 1034 } 1035 if m.S0 == nil { 1036 m.S0 = &Myproto4{} 1037 } 1038 if err := m.S0.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1039 return err 1040 } 1041 iNdEx = postIndex 1042 case 19: 1043 if wireType != 2 { 1044 return fmt.Errorf("proto: wrong wireType = %d for field F29", wireType) 1045 } 1046 var stringLen uint64 1047 for shift := uint(0); ; shift += 7 { 1048 if shift >= 64 { 1049 return ErrIntOverflowMyproto2 1050 } 1051 if iNdEx >= l { 1052 return io.ErrUnexpectedEOF 1053 } 1054 b := dAtA[iNdEx] 1055 iNdEx++ 1056 stringLen |= (uint64(b) & 0x7F) << shift 1057 if b < 0x80 { 1058 break 1059 } 1060 } 1061 intStringLen := int(stringLen) 1062 if intStringLen < 0 { 1063 return ErrInvalidLengthMyproto2 1064 } 1065 postIndex := iNdEx + intStringLen 1066 if postIndex > l { 1067 return io.ErrUnexpectedEOF 1068 } 1069 m.F29 = append(m.F29, string(dAtA[iNdEx:postIndex])) 1070 iNdEx = postIndex 1071 case 20: 1072 if wireType != 2 { 1073 return fmt.Errorf("proto: wrong wireType = %d for field F30", wireType) 1074 } 1075 var msglen int 1076 for shift := uint(0); ; shift += 7 { 1077 if shift >= 64 { 1078 return ErrIntOverflowMyproto2 1079 } 1080 if iNdEx >= l { 1081 return io.ErrUnexpectedEOF 1082 } 1083 b := dAtA[iNdEx] 1084 iNdEx++ 1085 msglen |= (int(b) & 0x7F) << shift 1086 if b < 0x80 { 1087 break 1088 } 1089 } 1090 if msglen < 0 { 1091 return ErrInvalidLengthMyproto2 1092 } 1093 postIndex := iNdEx + msglen 1094 if postIndex > l { 1095 return io.ErrUnexpectedEOF 1096 } 1097 m.F30 = append(m.F30, &Myproto4{}) 1098 if err := m.F30[len(m.F30)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1099 return err 1100 } 1101 iNdEx = postIndex 1102 default: 1103 iNdEx = preIndex 1104 skippy, err := skipMyproto2(dAtA[iNdEx:]) 1105 if err != nil { 1106 return err 1107 } 1108 if skippy < 0 { 1109 return ErrInvalidLengthMyproto2 1110 } 1111 if (iNdEx + skippy) > l { 1112 return io.ErrUnexpectedEOF 1113 } 1114 iNdEx += skippy 1115 } 1116 } 1117 1118 if iNdEx > l { 1119 return io.ErrUnexpectedEOF 1120 } 1121 return nil 1122 } 1123 func skipMyproto2(dAtA []byte) (n int, err error) { 1124 l := len(dAtA) 1125 iNdEx := 0 1126 for iNdEx < l { 1127 var wire uint64 1128 for shift := uint(0); ; shift += 7 { 1129 if shift >= 64 { 1130 return 0, ErrIntOverflowMyproto2 1131 } 1132 if iNdEx >= l { 1133 return 0, io.ErrUnexpectedEOF 1134 } 1135 b := dAtA[iNdEx] 1136 iNdEx++ 1137 wire |= (uint64(b) & 0x7F) << shift 1138 if b < 0x80 { 1139 break 1140 } 1141 } 1142 wireType := int(wire & 0x7) 1143 switch wireType { 1144 case 0: 1145 for shift := uint(0); ; shift += 7 { 1146 if shift >= 64 { 1147 return 0, ErrIntOverflowMyproto2 1148 } 1149 if iNdEx >= l { 1150 return 0, io.ErrUnexpectedEOF 1151 } 1152 iNdEx++ 1153 if dAtA[iNdEx-1] < 0x80 { 1154 break 1155 } 1156 } 1157 return iNdEx, nil 1158 case 1: 1159 iNdEx += 8 1160 return iNdEx, nil 1161 case 2: 1162 var length int 1163 for shift := uint(0); ; shift += 7 { 1164 if shift >= 64 { 1165 return 0, ErrIntOverflowMyproto2 1166 } 1167 if iNdEx >= l { 1168 return 0, io.ErrUnexpectedEOF 1169 } 1170 b := dAtA[iNdEx] 1171 iNdEx++ 1172 length |= (int(b) & 0x7F) << shift 1173 if b < 0x80 { 1174 break 1175 } 1176 } 1177 iNdEx += length 1178 if length < 0 { 1179 return 0, ErrInvalidLengthMyproto2 1180 } 1181 return iNdEx, nil 1182 case 3: 1183 for { 1184 var innerWire uint64 1185 var start int = iNdEx 1186 for shift := uint(0); ; shift += 7 { 1187 if shift >= 64 { 1188 return 0, ErrIntOverflowMyproto2 1189 } 1190 if iNdEx >= l { 1191 return 0, io.ErrUnexpectedEOF 1192 } 1193 b := dAtA[iNdEx] 1194 iNdEx++ 1195 innerWire |= (uint64(b) & 0x7F) << shift 1196 if b < 0x80 { 1197 break 1198 } 1199 } 1200 innerWireType := int(innerWire & 0x7) 1201 if innerWireType == 4 { 1202 break 1203 } 1204 next, err := skipMyproto2(dAtA[start:]) 1205 if err != nil { 1206 return 0, err 1207 } 1208 iNdEx = start + next 1209 } 1210 return iNdEx, nil 1211 case 4: 1212 return iNdEx, nil 1213 case 5: 1214 iNdEx += 4 1215 return iNdEx, nil 1216 default: 1217 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1218 } 1219 } 1220 panic("unreachable") 1221 } 1222 1223 var ( 1224 ErrInvalidLengthMyproto2 = fmt.Errorf("proto: negative length found during unmarshaling") 1225 ErrIntOverflowMyproto2 = fmt.Errorf("proto: integer overflow") 1226 ) 1227 1228 func init() { proto.RegisterFile("myproto2.proto", fileDescriptorMyproto2) } 1229 1230 var fileDescriptorMyproto2 = []byte{ 1231 // 300 bytes of a gzipped FileDescriptorProto 1232 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0xd1, 0xbb, 0x4e, 0xf3, 0x30, 1233 0x14, 0xc0, 0xf1, 0xef, 0xd8, 0x6d, 0xbf, 0xd6, 0xbd, 0x10, 0x4c, 0x87, 0x33, 0x45, 0x47, 0x15, 1234 0x42, 0x16, 0x43, 0x94, 0x38, 0xb7, 0x66, 0x65, 0xf0, 0xc6, 0xe2, 0x3e, 0x01, 0x45, 0x48, 0x48, 1235 0xa8, 0x14, 0x15, 0x16, 0x5e, 0x81, 0x89, 0xc7, 0x62, 0xe4, 0x11, 0x50, 0x78, 0x11, 0x14, 0x3b, 1236 0x86, 0x09, 0x31, 0xc5, 0xff, 0x9f, 0x9d, 0x28, 0x3a, 0x16, 0x8b, 0xdd, 0xf3, 0xc3, 0x61, 0xff, 1237 0xb4, 0xd7, 0x89, 0x7b, 0x48, 0xb1, 0xbd, 0xb9, 0xbf, 0xbe, 0xdd, 0x5d, 0x1d, 0xee, 0x1e, 0x57, 1238 0xe7, 0x62, 0x7c, 0xe9, 0x77, 0x0b, 0xb9, 0x10, 0xcc, 0xe4, 0xc8, 0x09, 0x14, 0x58, 0x66, 0x72, 1239 0xd7, 0x05, 0x0e, 0x08, 0xd4, 0xc4, 0x32, 0x53, 0xac, 0x5e, 0xf8, 0xf7, 0x61, 0xbf, 0x99, 0x21, 1240 0x10, 0xa8, 0xb1, 0x65, 0x26, 0x73, 0xad, 0x91, 0x11, 0x28, 0x66, 0x99, 0xd1, 0x7f, 0x7d, 0xcc, 1241 0x75, 0x89, 0x43, 0x02, 0x35, 0xb3, 0xcc, 0x94, 0xae, 0x2b, 0x1c, 0x11, 0xa8, 0xa1, 0x65, 0xa6, 1242 0x72, 0x5d, 0xe3, 0xff, 0xbe, 0x6b, 0xd7, 0x6b, 0x1c, 0xf7, 0xbd, 0x76, 0xdd, 0xe0, 0xa4, 0xef, 1243 0x46, 0x46, 0x82, 0x9b, 0x2c, 0x45, 0x41, 0xa0, 0xb8, 0xed, 0x96, 0x5e, 0x32, 0x9c, 0x06, 0xc9, 1244 0xbc, 0x68, 0x9c, 0x11, 0xa8, 0x79, 0x27, 0xda, 0x4b, 0x8e, 0xf3, 0x20, 0xb9, 0x97, 0x02, 0x17, 1245 0x41, 0x0a, 0x2f, 0x25, 0x1e, 0x05, 0x29, 0xbd, 0x54, 0x18, 0x11, 0xa8, 0x41, 0x27, 0x95, 0x97, 1246 0x1a, 0x8f, 0x83, 0xd4, 0xf2, 0x54, 0xb0, 0x4d, 0x8a, 0x92, 0x40, 0x4d, 0xf5, 0x32, 0xf9, 0x99, 1247 0x78, 0x12, 0xc6, 0x6d, 0xd9, 0xc6, 0xff, 0xa3, 0x6e, 0xf0, 0x84, 0xb8, 0x9a, 0xd8, 0x6e, 0x29, 1248 0xcf, 0x04, 0x37, 0x79, 0x8a, 0x4b, 0xe2, 0xbf, 0xbe, 0xd8, 0x1d, 0xb8, 0x88, 0xde, 0xda, 0x18, 1249 0xde, 0xdb, 0x18, 0x3e, 0xda, 0x18, 0x5e, 0x3f, 0xe3, 0x7f, 0xdb, 0x91, 0xbf, 0x99, 0xaf, 0x00, 1250 0x00, 0x00, 0xff, 0xff, 0x6f, 0xb4, 0xde, 0x3c, 0xef, 0x01, 0x00, 0x00, 1251 }