Documentation ¶
Index ¶
- Variables
- type List
- func (l *List) Append(items ...interface{})
- func (l *List) Count(value interface{}) int
- func (l *List) Delete(index int) error
- func (l *List) Extend(target_list List)
- func (l *List) Index(value interface{}) (int, error)
- func (l *List) Insert(index int, value interface{})
- func (l *List) Len() int
- func (l *List) Pop(index ...interface{}) (interface{}, error)
- func (l *List) Remove(value interface{}) error
- func (l *List) Reverse()
- func (l List) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmptyListError = "%v operation from empty list" OutOfRangeError = "%s index out of range" )
Functions ¶
This section is empty.
Types ¶
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (*List) Append ¶
func (l *List) Append(items ...interface{})
Adds an item to the end of the list data
func (*List) Index ¶
Returns the index in the list of the first item whose value is x. It is an error if there is no such item.
func (*List) Insert ¶
Insert an item at a given position. The first argument is the index of the element before which to insert
func (*List) Pop ¶
Remove the index at the given position in the list, and return it. If no index is specified, removes and returns the last item in the list.
Click to show internal directories.
Click to hide internal directories.