MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / DecodeNonsortingStdlibUvarint

Function DecodeNonsortingStdlibUvarint

pkg/util/encoding/encoding.go:1771–1779  ·  view source on GitHub ↗

DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It returns the length of the encoded varint and value.

(
	buf []byte,
)

Source from the content-addressed store, hash-verified

1769// DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It
1770// returns the length of the encoded varint and value.
1771func 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.

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…