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

Function decodeJSONValue

pkg/util/json/encode.go:290–307  ·  view source on GitHub ↗
(e jEntry, b []byte)

Source from the content-addressed store, hash-verified

288}
289
290func decodeJSONValue(e jEntry, b []byte) ([]byte, JSON, error) {
291 switch e.typCode {
292 case trueTag:
293 return b, TrueJSONValue, nil
294 case falseTag:
295 return b, FalseJSONValue, nil
296 case nullTag:
297 return b, NullJSONValue, nil
298 case stringTag:
299 return b[e.length:], jsonString(b[:e.length]), nil
300 case numberTag:
301 return decodeJSONNumber(b)
302 case containerTag:
303 return DecodeJSON(b)
304 }
305 return b, nil, errors.AssertionFailedf(
306 "error decoding JSON value, unexpected type code: %d", errors.Safe(e.typCode))
307}

Callers 3

DecodeJSONFunction · 0.85
decodeJSONArrayFunction · 0.85
decodeJSONObjectFunction · 0.85

Calls 3

jsonStringTypeAlias · 0.85
decodeJSONNumberFunction · 0.85
DecodeJSONFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…