From ca407b41947d1e597fe373a0125055f7631a9e1a Mon Sep 17 00:00:00 2001 From: Puru <40428133+tuladhar-p@users.noreply.github.com> Date: Thu, 17 Jan 2019 11:30:17 +0545 Subject: [PATCH] Fix slicing slides comment Slicing a slice includes the first element but excludes the last one, this commit fixes that in the comment. --- structures/slices.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/structures/slices.go b/structures/slices.go index 30e26fa..2196ef5 100644 --- a/structures/slices.go +++ b/structures/slices.go @@ -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")