MCPcopy
hub / github.com/grafana/tempo / Unmarshal

Method Unmarshal

tempodb/backend/v1.pb.go:652–1049  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

650 return sovV1(uint64((x << 1) ^ uint64((int64(x) >> 63))))
651}
652func (m *BlockMeta) Unmarshal(dAtA []byte) error {
653 l := len(dAtA)
654 iNdEx := 0
655 for iNdEx < l {
656 preIndex := iNdEx
657 var wire uint64
658 for shift := uint(0); ; shift += 7 {
659 if shift >= 64 {
660 return ErrIntOverflowV1
661 }
662 if iNdEx >= l {
663 return io.ErrUnexpectedEOF
664 }
665 b := dAtA[iNdEx]
666 iNdEx++
667 wire |= uint64(b&0x7F) << shift
668 if b < 0x80 {
669 break
670 }
671 }
672 fieldNum := int32(wire >> 3)
673 wireType := int(wire & 0x7)
674 if wireType == 4 {
675 return fmt.Errorf("proto: BlockMeta: wiretype end group for non-group")
676 }
677 if fieldNum <= 0 {
678 return fmt.Errorf("proto: BlockMeta: illegal tag %d (wire type %d)", fieldNum, wire)
679 }
680 switch fieldNum {
681 case 1:
682 if wireType != 2 {
683 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
684 }
685 var stringLen uint64
686 for shift := uint(0); ; shift += 7 {
687 if shift >= 64 {
688 return ErrIntOverflowV1
689 }
690 if iNdEx >= l {
691 return io.ErrUnexpectedEOF
692 }
693 b := dAtA[iNdEx]
694 iNdEx++
695 stringLen |= uint64(b&0x7F) << shift
696 if b < 0x80 {
697 break
698 }
699 }
700 intStringLen := int(stringLen)
701 if intStringLen < 0 {
702 return ErrInvalidLengthV1
703 }
704 postIndex := iNdEx + intStringLen
705 if postIndex < 0 {
706 return ErrInvalidLengthV1
707 }
708 if postIndex > l {
709 return io.ErrUnexpectedEOF

Callers 4

XXX_UnmarshalMethod · 0.95
TestRoundTripMetaFunction · 0.95

Calls 2

skipV1Function · 0.85
UnmarshalMethod · 0.65

Tested by 3

TestRoundTripMetaFunction · 0.76