| 557 | return nil |
| 558 | } |
| 559 | func (m *KeyValuePair) Unmarshal(dAtA []byte) error { |
| 560 | l := len(dAtA) |
| 561 | iNdEx := 0 |
| 562 | for iNdEx < l { |
| 563 | preIndex := iNdEx |
| 564 | var wire uint64 |
| 565 | for shift := uint(0); ; shift += 7 { |
| 566 | if shift >= 64 { |
| 567 | return ErrIntOverflowKv |
| 568 | } |
| 569 | if iNdEx >= l { |
| 570 | return io.ErrUnexpectedEOF |
| 571 | } |
| 572 | b := dAtA[iNdEx] |
| 573 | iNdEx++ |
| 574 | wire |= uint64(b&0x7F) << shift |
| 575 | if b < 0x80 { |
| 576 | break |
| 577 | } |
| 578 | } |
| 579 | fieldNum := int32(wire >> 3) |
| 580 | wireType := int(wire & 0x7) |
| 581 | if wireType == 4 { |
| 582 | return fmt.Errorf("proto: KeyValuePair: wiretype end group for non-group") |
| 583 | } |
| 584 | if fieldNum <= 0 { |
| 585 | return fmt.Errorf("proto: KeyValuePair: illegal tag %d (wire type %d)", fieldNum, wire) |
| 586 | } |
| 587 | switch fieldNum { |
| 588 | case 1: |
| 589 | if wireType != 2 { |
| 590 | return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 591 | } |
| 592 | var stringLen uint64 |
| 593 | for shift := uint(0); ; shift += 7 { |
| 594 | if shift >= 64 { |
| 595 | return ErrIntOverflowKv |
| 596 | } |
| 597 | if iNdEx >= l { |
| 598 | return io.ErrUnexpectedEOF |
| 599 | } |
| 600 | b := dAtA[iNdEx] |
| 601 | iNdEx++ |
| 602 | stringLen |= uint64(b&0x7F) << shift |
| 603 | if b < 0x80 { |
| 604 | break |
| 605 | } |
| 606 | } |
| 607 | intStringLen := int(stringLen) |
| 608 | if intStringLen < 0 { |
| 609 | return ErrInvalidLengthKv |
| 610 | } |
| 611 | postIndex := iNdEx + intStringLen |
| 612 | if postIndex < 0 { |
| 613 | return ErrInvalidLengthKv |
| 614 | } |
| 615 | if postIndex > l { |
| 616 | return io.ErrUnexpectedEOF |