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

Function validContainerPrimitive

parser.go:2377–2389  ·  view source on GitHub ↗

SYS-REQ-112

(value []byte)

Source from the content-addressed store, hash-verified

2375
2376// SYS-REQ-112
2377func validContainerPrimitive(value []byte) bool {
2378 for len(value) > 0 && isContainerWhitespace(value[len(value)-1]) {
2379 value = value[:len(value)-1]
2380 }
2381 if len(value) == 0 {
2382 return false
2383 }
2384
2385 if bytes.Equal(value, trueLiteral) || bytes.Equal(value, falseLiteral) || bytes.Equal(value, nullLiteral) {
2386 return true
2387 }
2388 return validJSONNumber(value)
2389}
2390
2391// SYS-REQ-112
2392func validJSONNumber(value []byte) bool {

Callers 1

scanContainerLenFunction · 0.85

Calls 2

isContainerWhitespaceFunction · 0.85
validJSONNumberFunction · 0.85

Tested by

no test coverage detected