Skip to content

Commit

Permalink
Fix builtin
Browse files Browse the repository at this point in the history
Signed-off-by: James Hamlin <[email protected]>
  • Loading branch information
jfhamlin committed Jan 28, 2024
1 parent be13c12 commit 760965e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/lang/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func GoSlice(slc interface{}, indices ...interface{}) interface{} {
if len(indices) == 0 {
panic(fmt.Errorf("slice: no indices"))
}
if len(indices) == 1 {
if len(indices) >= 1 {
if !IsNil(indices[0]) {
i = MustAsInt(indices[0])
}
Expand All @@ -221,6 +221,7 @@ func GoSlice(slc interface{}, indices ...interface{}) interface{} {
j = MustAsInt(indices[1])
}
}

return slcVal.Slice(i, j).Interface()
}

Expand Down

0 comments on commit 760965e

Please sign in to comment.