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

Function decodeValueTypeAssert

pkg/util/encoding/encoding.go:3192–3202  ·  view source on GitHub ↗
(b []byte, expected Type)

Source from the content-addressed store, hash-verified

3190}
3191
3192func decodeValueTypeAssert(b []byte, expected Type) ([]byte, error) {
3193 _, dataOffset, _, typ, err := DecodeValueTag(b)
3194 if err != nil {
3195 return b, err
3196 }
3197 b = b[dataOffset:]
3198 if typ != expected {
3199 return b, errors.Errorf("value type is not %s: %s", expected, typ)
3200 }
3201 return b, nil
3202}
3203
3204// PeekValueLength returns the length of the encoded value at the start of b.
3205// Note: If this function succeeds, it's not a guarantee that decoding the value

Callers 10

DecodeIntValueFunction · 0.85
DecodeFloatValueFunction · 0.85
DecodeBytesValueFunction · 0.85
DecodeTimeValueFunction · 0.85
DecodeTimeTZValueFunction · 0.85
DecodeDecimalValueFunction · 0.85
DecodeDurationValueFunction · 0.85
DecodeBitArrayValueFunction · 0.85
DecodeUUIDValueFunction · 0.85
DecodeIPAddrValueFunction · 0.85

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…