Skip to content

Commit e1e742a

Browse files
slices: remove index 2 value from example output as the ending index is exclusive in about.md (#2066)
1 parent 9f42e08 commit e1e742a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

concepts/slices/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you don't specify an ending index, it defaults to the length of the slice.
2727

2828
```go
2929
newSlice := withData[2:4] // newSlice == []int{2,3}
30-
newSlice := withData[:2] // newSlice == []int{0,1,2}
30+
newSlice := withData[:2] // newSlice == []int{0,1}
3131
newSlice := withData[2:] // newSlice == []int{2,3,4,5}
3232
newSlice := withData[:] // newSlice == []int{0,1,2,3,4,5}
3333
```

0 commit comments

Comments
 (0)