Logo

Programming-Idioms

History of Idiom 117 > diff from v1 to v2

Edit summary for version 2 by :
[Go] The list could be a slice, but also an array

Version 1

2016-01-13, 13:57:02

Version 2

2016-01-13, 13:58:35

Idiom #117 Get list size

Set n to the number of elements of list x.

Idiom #117 Get list size

Set n to the number of elements of list x.

Code
n := len(x)
Code
n := len(x)
Comments bubble
x is a slice.
Comments bubble
x is a slice or an array.
Demo URL
http://play.golang.org/p/y7S5eAxnK_
Demo URL
http://play.golang.org/p/e-8WVe52yM