Skip to content

Leading whitespaces lead to incorrect results (jsonparser.ArrayEach) #150

@coxx

Description

@coxx
data := []byte(`[1, 2, 3]`)
jsonparser.ArrayEach(data, func(value []byte, dataType jsonparser.ValueType, offset int, err error) {
    fmt.Println(string(value))
})

returns

1
2
3

but

data := []byte(`    [1, 2, 3]`)
jsonparser.ArrayEach(data, func(value []byte, dataType jsonparser.ValueType, offset int, err error) {
    fmt.Println(string(value))
})

returns

[1, 2, 3]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions