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

Method Unmarshal

ring/ring.pb.go:753–934  ·  ring/ring.pb.go::Desc.Unmarshal
(dAtA []byte)

Source from the content-addressed store, hash-verified

751 return fmt.Sprintf("*%v", pv)
752}
753func (m *Desc) Unmarshal(dAtA []byte) error {
754 l := len(dAtA)
755 iNdEx := 0
756 for iNdEx < l {
757 preIndex := iNdEx
758 var wire uint64
759 for shift := uint(0); ; shift += 7 {
760 if shift >= 64 {
761 return ErrIntOverflowRing
762 }
763 if iNdEx >= l {
764 return io.ErrUnexpectedEOF
765 }
766 b := dAtA[iNdEx]
767 iNdEx++
768 wire |= uint64(b&0x7F) << shift
769 if b < 0x80 {
770 break
771 }
772 }
773 fieldNum := int32(wire >> 3)
774 wireType := int(wire & 0x7)
775 if wireType == 4 {
776 return fmt.Errorf("proto: Desc: wiretype end group for non-group")
777 }
778 if fieldNum <= 0 {
779 return fmt.Errorf("proto: Desc: illegal tag %d (wire type %d)", fieldNum, wire)
780 }
781 switch fieldNum {
782 case 1:
783 if wireType != 2 {
784 return fmt.Errorf("proto: wrong wireType = %d for field Ingesters", wireType)
785 }
786 var msglen int
787 for shift := uint(0); ; shift += 7 {
788 if shift >= 64 {
789 return ErrIntOverflowRing
790 }
791 if iNdEx >= l {
792 return io.ErrUnexpectedEOF
793 }
794 b := dAtA[iNdEx]
795 iNdEx++
796 msglen |= int(b&0x7F) << shift
797 if b < 0x80 {
798 break
799 }
800 }
801 if msglen < 0 {
802 return ErrInvalidLengthRing
803 }
804 postIndex := iNdEx + msglen
805 if postIndex < 0 {
806 return ErrInvalidLengthRing
807 }
808 if postIndex > l {
809 return io.ErrUnexpectedEOF
810 }

Callers 15

XXX_UnmarshalMethod · 0.95
valueLoaderFunction · 0.45
unmarshalMaybeGzippedMethod · 0.45
TestStringSliceCSVMultiFunction · 0.45
TestDayValueYAMLFunction · 0.45
TestURLValueYAMLFunction · 0.45
Test_Bytes_UnmarshalYAMLFunction · 0.45
SetMethod · 0.45

Calls 3

UnmarshalMethod · 0.95
skipRingFunction · 0.85
ErrorfMethod · 0.80

Tested by 13

valueLoaderFunction · 0.36
TestStringSliceCSVMultiFunction · 0.36
TestDayValueYAMLFunction · 0.36
TestURLValueYAMLFunction · 0.36
Test_Bytes_UnmarshalYAMLFunction · 0.36
TestTimeYAMLFunction · 0.36
TestSecretdYAMLFunction · 0.36
Test_StringSliceCSVFunction · 0.36