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

Function DecodeBoolValue

pkg/util/encoding/encoding.go:2065–2079  ·  view source on GitHub ↗

DecodeBoolValue decodes a value encoded by EncodeBoolValue.

(buf []byte)

Source from the content-addressed store, hash-verified

2063
2064// DecodeBoolValue decodes a value encoded by EncodeBoolValue.
2065func DecodeBoolValue(buf []byte) (remaining []byte, b bool, err error) {
2066 _, dataOffset, _, typ, err := DecodeValueTag(buf)
2067 if err != nil {
2068 return buf, false, err
2069 }
2070 buf = buf[dataOffset:]
2071 switch typ {
2072 case True:
2073 return buf, true, nil
2074 case False:
2075 return buf, false, nil
2076 default:
2077 return buf, false, fmt.Errorf("value type is not %s or %s: %s", True, False, typ)
2078 }
2079}
2080
2081// DecodeIntValue decodes a value encoded by EncodeIntValue.
2082func DecodeIntValue(b []byte) (remaining []byte, i int64, err error) {

Callers

nothing calls this directly

Calls 1

DecodeValueTagFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…