MCPcopy Create free account
hub / github.com/cockroachdb/errors / Unmarshal

Method Unmarshal

errorspb/errors.pb.go:1883–2083  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

1881 return nil
1882}
1883func (m *ErrnoPayload) Unmarshal(dAtA []byte) error {
1884 l := len(dAtA)
1885 iNdEx := 0
1886 for iNdEx < l {
1887 preIndex := iNdEx
1888 var wire uint64
1889 for shift := uint(0); ; shift += 7 {
1890 if shift >= 64 {
1891 return ErrIntOverflowErrors
1892 }
1893 if iNdEx >= l {
1894 return io.ErrUnexpectedEOF
1895 }
1896 b := dAtA[iNdEx]
1897 iNdEx++
1898 wire |= uint64(b&0x7F) << shift
1899 if b < 0x80 {
1900 break
1901 }
1902 }
1903 fieldNum := int32(wire >> 3)
1904 wireType := int(wire & 0x7)
1905 if wireType == 4 {
1906 return fmt.Errorf("proto: ErrnoPayload: wiretype end group for non-group")
1907 }
1908 if fieldNum <= 0 {
1909 return fmt.Errorf("proto: ErrnoPayload: illegal tag %d (wire type %d)", fieldNum, wire)
1910 }
1911 switch fieldNum {
1912 case 1:
1913 if wireType != 0 {
1914 return fmt.Errorf("proto: wrong wireType = %d for field OrigErrno", wireType)
1915 }
1916 m.OrigErrno = 0
1917 for shift := uint(0); ; shift += 7 {
1918 if shift >= 64 {
1919 return ErrIntOverflowErrors
1920 }
1921 if iNdEx >= l {
1922 return io.ErrUnexpectedEOF
1923 }
1924 b := dAtA[iNdEx]
1925 iNdEx++
1926 m.OrigErrno |= int64(b&0x7F) << shift
1927 if b < 0x80 {
1928 break
1929 }
1930 }
1931 case 2:
1932 if wireType != 2 {
1933 return fmt.Errorf("proto: wrong wireType = %d for field Arch", wireType)
1934 }
1935 var stringLen uint64
1936 for shift := uint(0); ; shift += 7 {
1937 if shift >= 64 {
1938 return ErrIntOverflowErrors
1939 }
1940 if iNdEx >= l {

Callers 1

XXX_UnmarshalMethod · 0.95

Calls 1

skipErrorsFunction · 0.85

Tested by

no test coverage detected