MCPcopy Create free account
hub / github.com/tidwall/gjson / validarray

Function validarray

gjson.go:2591–2613  ·  view source on GitHub ↗
(data []byte, i int)

Source from the content-addressed store, hash-verified

2589 return i, false
2590}
2591func validarray(data []byte, i int) (outi int, ok bool) {
2592 for ; i < len(data); i++ {
2593 switch data[i] {
2594 default:
2595 for ; i < len(data); i++ {
2596 if i, ok = validany(data, i); !ok {
2597 return i, false
2598 }
2599 if i, ok = validcomma(data, i, ']'); !ok {
2600 return i, false
2601 }
2602 if data[i] == ']' {
2603 return i + 1, true
2604 }
2605 }
2606 case ' ', '\t', '\n', '\r':
2607 continue
2608 case ']':
2609 return i + 1, true
2610 }
2611 }
2612 return i, false
2613}
2614func validstring(data []byte, i int) (outi int, ok bool) {
2615 for ; i < len(data); i++ {
2616 if data[i] < ' ' {

Callers 1

validanyFunction · 0.85

Calls 2

validanyFunction · 0.85
validcommaFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…