DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It returns the length of the encoded varint and value.
( buf []byte, )
| 858 | // DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It |
| 859 | // returns the length of the encoded varint and value. |
| 860 | func DecodeNonsortingStdlibUvarint( |
| 861 | buf []byte, |
| 862 | ) (remaining []byte, length int, value uint64, err error) { |
| 863 | i, n := binary.Uvarint(buf) |
| 864 | if n <= 0 { |
| 865 | return buf, 0, 0, errors.New("buffer too small") |
| 866 | } |
| 867 | return buf[n:], n, i, nil |
| 868 | } |
| 869 | |
| 870 | // EncodeUntaggedDecimalValue encodes an apd.Decimal value, appends it to the supplied |
| 871 | // buffer, and returns the final buffer. |
no outgoing calls
no test coverage detected