title: InvalidLen layout: article

InvalidLen occurs when an argument to the len built-in function is not of
supported type.

See https://golang.org/ref/spec#Length_and_capacity for information on
which underlying types are supported as arguments to cap and len.

Example:
 var s = 2
 var x = len(s)