| 3505 | return nil |
| 3506 | } |
| 3507 | func (m *KvInt) Unmarshal(data []byte) error { |
| 3508 | var hasFields [1]uint64 |
| 3509 | l := len(data) |
| 3510 | iNdEx := 0 |
| 3511 | for iNdEx < l { |
| 3512 | preIndex := iNdEx |
| 3513 | var wire uint64 |
| 3514 | for shift := uint(0); ; shift += 7 { |
| 3515 | if shift >= 64 { |
| 3516 | return ErrIntOverflowSql |
| 3517 | } |
| 3518 | if iNdEx >= l { |
| 3519 | return io.ErrUnexpectedEOF |
| 3520 | } |
| 3521 | b := data[iNdEx] |
| 3522 | iNdEx++ |
| 3523 | wire |= (uint64(b) & 0x7F) << shift |
| 3524 | if b < 0x80 { |
| 3525 | break |
| 3526 | } |
| 3527 | } |
| 3528 | fieldNum := int32(wire >> 3) |
| 3529 | wireType := int(wire & 0x7) |
| 3530 | if wireType == 4 { |
| 3531 | return fmt.Errorf("proto: KvInt: wiretype end group for non-group") |
| 3532 | } |
| 3533 | if fieldNum <= 0 { |
| 3534 | return fmt.Errorf("proto: KvInt: illegal tag %d (wire type %d)", fieldNum, wire) |
| 3535 | } |
| 3536 | switch fieldNum { |
| 3537 | case 1: |
| 3538 | if wireType != 2 { |
| 3539 | return fmt.Errorf("proto: wrong wireType = %d for field K", wireType) |
| 3540 | } |
| 3541 | var stringLen uint64 |
| 3542 | for shift := uint(0); ; shift += 7 { |
| 3543 | if shift >= 64 { |
| 3544 | return ErrIntOverflowSql |
| 3545 | } |
| 3546 | if iNdEx >= l { |
| 3547 | return io.ErrUnexpectedEOF |
| 3548 | } |
| 3549 | b := data[iNdEx] |
| 3550 | iNdEx++ |
| 3551 | stringLen |= (uint64(b) & 0x7F) << shift |
| 3552 | if b < 0x80 { |
| 3553 | break |
| 3554 | } |
| 3555 | } |
| 3556 | intStringLen := int(stringLen) |
| 3557 | if intStringLen < 0 { |
| 3558 | return ErrInvalidLengthSql |
| 3559 | } |
| 3560 | postIndex := iNdEx + intStringLen |
| 3561 | if postIndex > l { |
| 3562 | return io.ErrUnexpectedEOF |
| 3563 | } |
| 3564 | m.K = string(data[iNdEx:postIndex]) |