We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f7d740 commit 95798c4Copy full SHA for 95798c4
1 file changed
internal/gofields/gofields.go
@@ -49,7 +49,7 @@ func getValue(value reflect.Value, parents []string, path []string) (reflect.Val
49
if err != nil {
50
return reflect.Value{}, fmt.Errorf("trying to access array %s but %s is not a numerical index", strings.Join(parents, "."), path[0])
51
}
52
- if idx > value.Len() {
+ if idx >= value.Len() {
53
return reflect.Value{}, fmt.Errorf("trying to access array %s but %d is out of range", strings.Join(parents, "."), idx)
54
55
return getValue(value.Index(idx), append(parents, path[0]), path[1:])
0 commit comments