Documentation
¶
Index ¶
- type List
- func (p *List[T]) Append(data ...T)
- func (p *List[T]) Clear()
- func (p *List[T]) Clone() (data []T)
- func (p *List[T]) First() (ret T, ok bool)
- func (p *List[T]) Get(i int) T
- func (p *List[T]) GetDefault(i int, v T) T
- func (p *List[T]) Last() (ret T, ok bool)
- func (p *List[T]) Len() int
- func (p *List[T]) Range(f func(index int, item T) bool)
- func (p *List[T]) Remove(i int, num int)
- func (p *List[T]) Set(i int, d T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
List is goroutine safe slice
func (*List[T]) GetDefault ¶
GetDefault return the value place at position i when i doesn't exist in list, then return v without panic
func (*List[T]) Range ¶
Range iter element of p with f if f return false, then break the range note: do not call any p's function inside f, otherwise will occur deadlock
Click to show internal directories.
Click to hide internal directories.