golang / tour

[mirror] A Tour of Go
BSD 3-Clause "New" or "Revised" License
1.55k stars 520 forks source link

tour: typo on Basics: More Types: Slice Defaults page #1574

Open AndiCai123 opened 8 months ago

AndiCai123 commented 8 months ago

Context: https://go.dev/tour/moretypes/10

The current description of slice defaults is as follows: "The default is zero for the low bound and the length of the slice for the high bound."

I think "length of the slice for the high bound" should instead be "length of the underlying array for the high bound", as the slice is being initialized and shouldn't have a length at this point, and it makes more sense logically since the implicit default high bound is the same as the length of the array.