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

Function DecodeBoolValue

pkg/util/encoding/encoding.go:2897–2911  ·  view source on GitHub ↗

DecodeBoolValue decodes a value encoded by EncodeBoolValue.

(buf []byte)

Source from the content-addressed store, hash-verified

2895
2896// DecodeBoolValue decodes a value encoded by EncodeBoolValue.
2897func DecodeBoolValue(buf []byte) (remaining []byte, b bool, err error) {
2898 _, dataOffset, _, typ, err := DecodeValueTag(buf)
2899 if err != nil {
2900 return buf, false, err
2901 }
2902 buf = buf[dataOffset:]
2903 switch typ {
2904 case True:
2905 return buf, true, nil
2906 case False:
2907 return buf, false, nil
2908 default:
2909 return buf, false, fmt.Errorf("value type is not %s or %s: %s", True, False, typ)
2910 }
2911}
2912
2913// DecodeIntValue decodes a value encoded by EncodeIntValue.
2914func DecodeIntValue(b []byte) (remaining []byte, i int64, err error) {

Callers

nothing calls this directly

Calls 2

DecodeValueTagFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…