Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
elgs committed Mar 31, 2016
1 parent 01492e8 commit a120c2c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gojq.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ func (jq *JQ) Query(exp string) (interface{}, error) {
}
switch v := context.(type) {
case []interface{}:
{
if len(v) <= index {
return nil, errors.New(fmt.Sprint(path, " index out of range."))
}
context = v[index]
if len(v) <= index {
return nil, errors.New(fmt.Sprint(path, " index out of range."))
}
context = v[index]
default:
return nil, errors.New(fmt.Sprint(path, " is not an array. ", v))
}
Expand Down

0 comments on commit a120c2c

Please sign in to comment.