Skip to content
Open
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
4 changes: 2 additions & 2 deletions structures/slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ func main() {
ss := ms[1:] // Every element after and including element at index 1
fmt.Printf("%v Length: %d\n", ss, len(ss))

ss = ms[:3] // Every element up to and including element at index 3
ss = ms[:3] // Every element up to but excluding element at index 3
fmt.Printf("%v Length: %d\n", ss, len(ss))

ss = ms[3:5] // Every element from (and including) index 3 to (and including) index 5
ss = ms[3:5] // Every element from (and including) index 3 to (and excluding) index 5
fmt.Printf("%v Length: %d\n", ss, len(ss))

tutorial.Section("Iterating over slices")
Expand Down