Skip to content

ArrayEach can not return error #176

Open
@dunixd

Description

@dunixd

jsonparser/parser.go

Lines 943 to 957 in bf1c66b

if e != nil {
return offset, e
}
if o == 0 {
break
}
if t != NotExist {
cb(v, t, offset+o-len(v), e)
}
if e != nil {
break
}

how to indicate that cb return an error for ArrayEach, like ObjectEach do.

jsonparser/parser.go

Lines 1053 to 1060 in bf1c66b

// Step 3: find the associated value, then invoke the callback
if value, valueType, off, err := Get(data[offset:]); err != nil {
return err
} else if err := callback(key, value, valueType, offset+off); err != nil { // Invoke the callback here!
return err
} else {
offset += off
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions