func New(items interface{}, size int) (*List, error) {
	if size < 1 {
		return nil, fmt.Errorf("list size %d must be greater than 0", size)
	}

	if items == nil || reflect.TypeOf(items).Kind() != reflect.Slice {
		return nil, fmt.Errorf("items %v is not a slice", items)
	}

	slice := reflect.ValueOf(items)
	values := make([]*interface{}, slice.Len())

	for i := range values {
		item := slice.Index(i).Interface()
		values[i] = &item
	}

	return &List{size: size, items: values, scope: values}, nil
}
func New(items interface{}, size int) (*List, error) {
	if size < 1 {
		return nil, fmt.Errorf("list size %d must be greater than 0", size)
	}

	if items == nil || reflect.TypeOf(items).Kind() != reflect.Slice {
		return nil, fmt.Errorf("items %v is not a slice", items)
	}

	slice := reflect.ValueOf(items)
	values := make([]*interface{}, slice.Len())

	for i := range values {
		item := slice.Index(i).Interface()
		values[i] = &item
	}

	return &List{size: size, items: values, scope: values}, nil
}
func New ( items interface { } , size int ) ( * List , error ) { if size < 1 { return nil , fmt . Errorf ( " " , size ) } if items == nil || reflect . TypeOf ( items ) . Kind ( ) != reflect . Slice { return nil , fmt . Errorf ( " " , items ) } slice := reflect . ValueOf ( items ) values := make ( [ ] * interface { } , slice . Len ( ) ) for i := range values { item := slice . Index ( i ) . Interface ( ) values [ i ] = & item } return & List { size : size , items : values , scope : values } , nil }
// New creates and initializes a list of searchable items. The items attribute must be a slice type with a
// size greater than 0. Error will be returned if those two conditions are not met.
New creates and initializes a list of searchable items . The items attribute must be a slice type with a size greater than 0 . Error will be returned if those two conditions are not met .