Skip to content

Length() function #6

@runemadsen

Description

@runemadsen

It would be cool to have a shorthand way of getting the length of a JSON array. For example with this JSON:

{
  "data" : [1, 2, 3]
}

... I currently need to do this to check the length:

arr, _ := jq.Array("data")
fmt.Println( len(arr) )

It would be nice to be able to do this:

fmt.Println( jq.Length("data") )

A small thing, but very handy.

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