Documentation ¶
Index ¶
- func HasInt(slice []int, item int) bool
- func HasIntVar(slice []*int, item int) bool
- func HasString(slice []string, item string) bool
- func HasStringVar(slice []*string, item string) bool
- func HasUint(slice []uint, item uint) bool
- func HasUintVar(slice []*uint, item uint) bool
- func Int(slice []int, item int, count int) (index []int)
- func IntAll(slice []int, item int) (index []int)
- func IntFunc(slice []int, item int, compareFunc CompareInts, count int) (index []int)
- func IntFuncAll(slice []int, item int, compareFunc CompareInts) (index []int)
- func IntMatch(slice []int, item int) (index int)
- func IntVar(slice []*int, item int, count int) (index []int)
- func IntVarAll(slice []*int, item int) (index []int)
- func IntVarFunc(slice []*int, item int, compareFunc CompareInts, count int) (index []int)
- func IntVarFuncAll(slice []*int, item int, compareFunc CompareInts) (index []int)
- func IntVarMatch(slice []*int, item int) (index int)
- func Reflect(slice interface{}, item interface{}, count int) (index []int, err error)
- func ReflectAll(slice interface{}, item interface{}) (index []int, err error)
- func String(slice []string, item string, count int) (index []int)
- func StringAll(slice []string, item string) (index []int)
- func StringFunc(slice []string, item string, compareFunc CompareStrings, count int) (index []int)
- func StringFuncAll(slice []string, item string, compareFunc CompareStrings) (index []int)
- func StringMatch(slice []string, item string) (index int)
- func StringVar(slice []*string, item string, count int) (index []int)
- func StringVarAll(slice []*string, item string) (index []int)
- func StringVarFunc(slice []*string, item string, compareFunc CompareStrings, count int) (index []int)
- func StringVarFuncAll(slice []*string, item string, compareFunc CompareStrings) (index []int)
- func StringVarMatch(slice []*string, item string) (index int)
- func Uint(slice []uint, item uint, count int) (index []int)
- func UintAll(slice []uint, item uint) (index []int)
- func UintFunc(slice []uint, item uint, compareFunc CompareUints, count int) (index []int)
- func UintFuncAll(slice []uint, item uint, compareFunc CompareUints) (index []int)
- func UintMatch(slice []uint, item uint) (index int)
- func UintVar(slice []*uint, item uint, count int) (index []int)
- func UintVarAll(slice []*uint, item uint) (index []int)
- func UintVarFunc(slice []*uint, item uint, compareFunc CompareUints, count int) (index []int)
- func UintVarFuncAll(slice []*uint, item uint, compareFunc CompareUints) (index []int)
- func UintVarMatch(slice []*uint, item uint) (index int)
- type CompareInts
- type CompareStrings
- type CompareUints
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasStringVar ¶
HasStringVar returns true if item is found in slice, or false if it hasn't
func HasUintVar ¶
HasUintVar returns true if item is found in slice, or false if it hasn't
func Int ¶
Int compares an item to a slice of items and return indexes of the first X matched entries.
func IntFunc ¶
func IntFunc(slice []int, item int, compareFunc CompareInts, count int) (index []int)
IntFunc return up to X results if item matches in slice, using external comparison function. For example, pass ints.Contains as func
func IntFuncAll ¶
func IntFuncAll(slice []int, item int, compareFunc CompareInts) (index []int)
IntFuncAll returns all results if item matches in slice, using external comparison function. For example, pass ints.Contains as func
func IntMatch ¶
IntMatch acts like Int, returning the index of the first found match returns -1 if item not found
func IntVar ¶
IntVar compares an item to a slice of item pointers and return indexes of the first X matched entries.
func IntVarFunc ¶
func IntVarFunc(slice []*int, item int, compareFunc CompareInts, count int) (index []int)
IntVarFunc return up to X results if item matches in slice, using external comparison function. For example, pass ints.Contains as func
func IntVarFuncAll ¶
func IntVarFuncAll(slice []*int, item int, compareFunc CompareInts) (index []int)
IntVarFuncAll returns all results if item matches in slice, using external comparison function. For example, pass ints.Contains as func
func IntVarMatch ¶
IntVarMatch acts like Int, returning the index of the first found match returns -1 if item not found
func Reflect ¶
Reflect performs a comparison on interface type (interface must be of type slice - i.e. slice of anything). The item and/or slice may be pointers to values (e.g. []*int and *int) or any mix of those. Only actual values are evaluated. May be slow compared to other functions.
func ReflectAll ¶
ReflectAll works like Reflect, but returns all items.
func String ¶
String compares an item to a slice of items and return indexes of the first X matched entries.
func StringFunc ¶
func StringFunc(slice []string, item string, compareFunc CompareStrings, count int) (index []int)
StringFunc return up to X results if item matches in slice, using external comparison function. For example, pass strings.Contains as func
func StringFuncAll ¶
func StringFuncAll(slice []string, item string, compareFunc CompareStrings) (index []int)
StringFuncAll returns all results if item matches in slice, using external comparison function. For example, pass strings.Contains as func
func StringMatch ¶
StringMatch acts like String, returning the index of the first found match returns -1 if item not found
func StringVar ¶
StringVar compares an item to a slice of item pointers and return indexes of the first X matched entries.
func StringVarAll ¶
StringVarAll acts like StringVar, looking for all occurrences.
func StringVarFunc ¶
func StringVarFunc(slice []*string, item string, compareFunc CompareStrings, count int) (index []int)
StringVarFunc return up to X results if item matches in slice, using external comparison function. For example, pass strings.Contains as func
func StringVarFuncAll ¶
func StringVarFuncAll(slice []*string, item string, compareFunc CompareStrings) (index []int)
StringVarFuncAll returns all results if item matches in slice, using external comparison function. For example, pass strings.Contains as func
func StringVarMatch ¶
StringVarMatch acts like String, returning the index of the first found match returns -1 if item not found
func Uint ¶
Uint compares an item to a slice of items and return indexes of the first X matched entries.
func UintFunc ¶
func UintFunc(slice []uint, item uint, compareFunc CompareUints, count int) (index []int)
UintFunc return up to X results if item matches in slice, using external comparison function. For example, pass uints.Contains as func
func UintFuncAll ¶
func UintFuncAll(slice []uint, item uint, compareFunc CompareUints) (index []int)
UintFuncAll returns all results if item matches in slice, using external comparison function. For example, pass uints.Contains as func
func UintMatch ¶
UintMatch acts like Uint, returning the index of the first found match returns -1 if item not found
func UintVar ¶
UintVar compares an item to a slice of item pouinters and return indexes of the first X matched entries.
func UintVarAll ¶
UintVarAll acts like UintVar, looking for all occurrences.
func UintVarFunc ¶
func UintVarFunc(slice []*uint, item uint, compareFunc CompareUints, count int) (index []int)
UintVarFunc return up to X results if item matches in slice, using external comparison function. For example, pass uints.Contains as func
func UintVarFuncAll ¶
func UintVarFuncAll(slice []*uint, item uint, compareFunc CompareUints) (index []int)
UintVarFuncAll returns all results if item matches in slice, using external comparison function. For example, pass uints.Contains as func
func UintVarMatch ¶
UintVarMatch acts like Uint, returning the index of the first found match returns -1 if item not found
Types ¶
type CompareInts ¶
CompareInts function is used in StringFunc and StringFuncAll to provide a third-party comparison
type CompareStrings ¶
CompareStrings function is used in StringFunc and StringFuncAll to provide a third-party comparison
type CompareUints ¶
CompareUints function is used in StringFunc and StringFuncAll to provide a third-party comparison