DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It returns the length of the encoded varint and value.
( buf []byte, )
| 1769 | // DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It |
| 1770 | // returns the length of the encoded varint and value. |
| 1771 | func DecodeNonsortingStdlibUvarint( |
| 1772 | buf []byte, |
| 1773 | ) (remaining []byte, length int, value uint64, err error) { |
| 1774 | i, n := binary.Uvarint(buf) |
| 1775 | if n <= 0 { |
| 1776 | return buf, 0, 0, errors.New("buffer too small") |
| 1777 | } |
| 1778 | return buf[n:], n, i, nil |
| 1779 | } |
| 1780 | |
| 1781 | // PeekLengthNonsortingUvarint returns the length of the value that starts at |
| 1782 | // the beginning of buf and was encoded by EncodeNonsortingUvarint. |
no outgoing calls
no test coverage detected
searching dependent graphs…