Documentation ¶
Index ¶
- Variables
- func Contain(slice interface{}, fn CondFunc) bool
- func Delete(slice interface{}, funcs ...CondFunc) error
- func Filter(slice interface{}, funcs ...CondFunc) error
- func Find(slice interface{}, fn CondFunc) (interface{}, error)
- func IndexOf(slice interface{}, fn CondFunc) (int, error)
- func LastIndexOf(slice interface{}, fn CondFunc) (int, error)
- func Reverse(slice interface{})
- func Select(slice interface{}, fn CondFunc) (interface{}, error)
- func Shuffle(slice interface{}, seeds ...int64) (e error)
- func Uniq(slice interface{}, fn IdentFn) error
- func Uniq2(slice interface{}, fn CompareFunc) error
- func UniqWithSort(slice interface{}, fn CompareFunc) (int, error)
- type CompareFunc
- type CondFunc
- type IdentFn
Constants ¶
This section is empty.
Variables ¶
var ( ERR_SLICE_TYPE error = errors.New("parameter must be slice or pointer of slice") ERR_POINTER_SLICE_TYPE error = errors.New("parameter must be pointer of slice") ERR_NOT_FOUND error = errors.New("data is not found") ERR_ELEMENT_INVALID_TYPE error = errors.New("slice element is invalid type") ERR_INVALID_INDEX error = errors.New("invalid index") )
Functions ¶
func Find ¶
Find is value of slice if fn is true. if slice is not pointer of slice or empty, return error
func IndexOf ¶
IndexOf gets the index at which the first match fn is true. if not found. return -1. return error if slice is not pointer of the slice.
func LastIndexOf ¶ added in v0.1.1
IndexOf gets the index at which the last match fn is true. if not found. return -1. return error if slice is not pointer of the slice.
func Reverse ¶ added in v0.1.2
func Reverse(slice interface{})
Reverse ... Transforms an array such that the first element will become the last, the second element will become the second to last, etc.
func Shuffle ¶
Shuffle is shuffing slice order. if slice is not pointer of slice or not slice, return error
func Uniq2 ¶
func Uniq2(slice interface{}, fn CompareFunc) error
Uniq2 is deduplicate using fn . if slice is not pointer of slice or empty, return error
func UniqWithSort ¶
func UniqWithSort(slice interface{}, fn CompareFunc) (int, error)
UniqWithSort is deduplicating using fn, sorting before dedup. if slice is not pointer of slice or empty, return error
Types ¶
type CompareFunc ¶
Directories ¶
Path | Synopsis |
---|---|
ContainerListWriter is a base of http://golang.org/pkg/container/list/ this is tuning performancem, reduce heap usage.
|
ContainerListWriter is a base of http://golang.org/pkg/container/list/ this is tuning performancem, reduce heap usage. |
Package loncha/list_head is like a kernel's LIST_HEAD list_head is used by loncha/gen/containers_list
|
Package loncha/list_head is like a kernel's LIST_HEAD list_head is used by loncha/gen/containers_list |
Package list_head ...
|
Package list_head ... |