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

Function ArrayEachErr

parser.go:1753–1756  ·  view source on GitHub ↗

ArrayEachErr is used when iterating arrays and allows the callback to stop iteration by returning an error. io.EOF stops iteration without returning an error. The returned count includes the element whose callback stopped the iteration. SYS-REQ-004

(data []byte, cb func(value []byte, dataType ValueType, offset int, err error) error, keys ...string)

Source from the content-addressed store, hash-verified

1751// iteration.
1752// SYS-REQ-004
1753func ArrayEachErr(data []byte, cb func(value []byte, dataType ValueType, offset int, err error) error, keys ...string) (count int, err error) {
1754 _, count, err = arrayEachErr(data, cb, keys...)
1755 return count, err
1756}
1757
1758// arrayEachErr also returns ArrayEach's closing-bracket offset for use by
1759// EachKeyErr while traversing array-index paths.

Callers 6

eachKeyWildcardFunction · 0.85
ArrayEachWildcardFunction · 0.85
expandWildcardPathsFunction · 0.85
EachArrayErrFunction · 0.85
TestEachArrayErrAliasFunction · 0.85
TestArrayEachErrFunction · 0.85

Calls 1

arrayEachErrFunction · 0.85

Tested by 2

TestEachArrayErrAliasFunction · 0.68
TestArrayEachErrFunction · 0.68