wuxing164 / go-tour

Automatically exported from code.google.com/p/go-tour
0 stars 0 forks source link

This is a small comment. However I found the slice assignment d := c[2:5] less helpful than d :=... #98

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
https://feedback.corp.google.com/#/Report/1058257696

Description:
This is a small comment. However I found the slice assignment
d := c[2:5]
less helpful than 
d := c[2:4]
where len(d) and cap(d) are different. It wasn't clear from 
d := c[2:5]
whether or not the the slices cap is 'truncated' to math the slice length.
However 
d := c[2:4]
is unambiguous as len(d) != cap(d)

Description translated:
This is a small comment. However I found the slice assignment
d := c[2:5]
less helpful than 
d := c[2:4]
where len(d) and cap(d) are different. It wasn't clear from 
d := c[2:5]
whether or not the the slices cap is 'truncated' to match the slice length.
However 
d := c[2:4]
is unambiguous as len(d) != cap(d)

UI language: en
Detected language: en

Original issue reported on code.google.com by feedback...@gmail.com on 26 Jul 2013 at 11:54