MCPcopy Create free account
hub / github.com/buger/jsonparser / validContainerPrimitive

Function validContainerPrimitive

parser.go:2471–2483  ·  view source on GitHub ↗

SYS-REQ-112

(value []byte)

Source from the content-addressed store, hash-verified

2469
2470// SYS-REQ-112
2471func validContainerPrimitive(value []byte) bool {
2472 for len(value) > 0 && isContainerWhitespace(value[len(value)-1]) {
2473 value = value[:len(value)-1]
2474 }
2475 if len(value) == 0 {
2476 return false
2477 }
2478
2479 if bytes.Equal(value, trueLiteral) || bytes.Equal(value, falseLiteral) || bytes.Equal(value, nullLiteral) {
2480 return true
2481 }
2482 return validJSONNumber(value)
2483}
2484
2485// SYS-REQ-112
2486func validJSONNumber(value []byte) bool {

Callers 1

scanContainerLenFunction · 0.85

Calls 2

isContainerWhitespaceFunction · 0.85
validJSONNumberFunction · 0.85

Tested by

no test coverage detected