MCPcopy
hub / github.com/tidwall/gjson / validpayload

Function validpayload

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

Source from the content-addressed store, hash-verified

2471}
2472
2473func validpayload(data []byte, i int) (outi int, ok bool) {
2474 for ; i < len(data); i++ {
2475 switch data[i] {
2476 default:
2477 i, ok = validany(data, i)
2478 if !ok {
2479 return i, false
2480 }
2481 for ; i < len(data); i++ {
2482 switch data[i] {
2483 default:
2484 return i, false
2485 case ' ', '\t', '\n', '\r':
2486 continue
2487 }
2488 }
2489 return i, true
2490 case ' ', '\t', '\n', '\r':
2491 continue
2492 }
2493 }
2494 return i, false
2495}
2496func validany(data []byte, i int) (outi int, ok bool) {
2497 for ; i < len(data); i++ {
2498 switch data[i] {

Callers 4

testvalidFunction · 0.85
TestValidRandomFunction · 0.85
ValidFunction · 0.85
ValidBytesFunction · 0.85

Calls 1

validanyFunction · 0.85

Tested by 2

testvalidFunction · 0.68
TestValidRandomFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…