Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/gofields/gofields.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func getValue(value reflect.Value, parents []string, path []string) (reflect.Val
if err != nil {
return reflect.Value{}, fmt.Errorf("trying to access array %s but %s is not a numerical index", strings.Join(parents, "."), path[0])
}
if idx > value.Len() {
if idx >= value.Len() {
return reflect.Value{}, fmt.Errorf("trying to access array %s but %d is out of range", strings.Join(parents, "."), idx)
}
return getValue(value.Index(idx), append(parents, path[0]), path[1:])
Expand Down