code: func length(item interface{}) (int, error) {
  	v, isNil := indirect(reflect.ValueOf(item))
  	if isNil {
  		return 0, fmt.Errorf("len of nil pointer")
  	}
  	switch v.Kind() {
  	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String:
  		return v.Len(), nil
  	}
  	return 0, fmt.Errorf("len of type %s", v.Type())
  }
docs: // Length
  // length returns the length of the item, with an error if it has no defined length.