8000 fix: fix test example · soulteary/golang-playground@7f6f3de · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f6f3de

Browse files
committed
fix: fix test example
1 parent ea37068 commit 7f6f3de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
// -1 if x is not present. The loop condition has a fault that
1010
// causes somes tests to fail. Change it to i >= 0 to see them pass.
1111
func LastIndex(list []int, x int) int {
12-
for i := len(list) - 1; i > 0; i-- {
12+
for i := len(list) - 1; i >= 0; i-- {
1313
if list[i] == x {
1414
return i
1515
}

0 commit comments

Comments
 (0)
0