Documentation ¶
Index ¶
- func Contains(slice []interface{}, value interface{}) bool
- func ContainsWith(slice []interface{}, value interface{}, equaller Equaller) bool
- func Count(slice []interface{}, value interface{}) int
- func CountWith(slice []interface{}, value interface{}, equaller Equaller) int
- func Delete(slice []interface{}, value interface{}, n int) []interface{}
- func DeleteAll(slice []interface{}, value interface{}) []interface{}
- func DeleteAllWith(slice []interface{}, value interface{}, equaller Equaller) []interface{}
- func DeleteWith(slice []interface{}, value interface{}, n int, equaller Equaller) []interface{}
- func Diff(s1 []interface{}, s2 []interface{}) []interface{}
- func DiffWith(s1 []interface{}, s2 []interface{}, equaller Equaller) []interface{}
- func Equal(s1 []interface{}, s2 []interface{}) bool
- func EqualWith(s1 []interface{}, s2 []interface{}, equaller Equaller) bool
- func ForEach(slice []interface{}, fn func(interface{}))
- func GenerateByIndex(indies []int, fn func(i int) interface{}) []interface{}
- func GoForEach(slice []interface{}, each func(interface{}))
- func IndexOf(slice []interface{}, value interface{}) int
- func IndexOfWith(slice []interface{}, value interface{}, equaller Equaller) int
- func Intersection(s1 []interface{}, s2 []interface{}) []interface{}
- func IntersectionWith(s1 []interface{}, s2 []interface{}, equaller Equaller) []interface{}
- func Its(slice []interface{}, model interface{}) interface{}
- func ItsOfByte(slice []interface{}) []byte
- func ItsOfFloat32(slice []interface{}) []float32
- func ItsOfFloat64(slice []interface{}) []float64
- func ItsOfInt(slice []interface{}) []int
- func ItsOfInt16(slice []interface{}) []int16
- func ItsOfInt32(slice []interface{}) []int32
- func ItsOfInt64(slice []interface{}) []int64
- func ItsOfInt8(slice []interface{}) []int8
- func ItsOfRune(slice []interface{}) []rune
- func ItsOfString(slice []interface{}) []string
- func ItsOfUint(slice []interface{}) []uint
- func ItsOfUint16(slice []interface{}) []uint16
- func ItsOfUint32(slice []interface{}) []uint32
- func ItsOfUint64(slice []interface{}) []uint64
- func ItsOfUint8(slice []interface{}) []uint8
- func ItsToString(slice []interface{}) []string
- func Map(slice []interface{}, mapper func(interface{}) interface{}) []interface{}
- func Range(min, max, step int) []int
- func Reverse(slice []interface{})
- func ReverseNew(slice []interface{}) []interface{}
- func ReverseRange(min, max, step int) []int
- func Shuffle(slice []interface{})
- func ShuffleNew(slice []interface{}) []interface{}
- func Sort(s []interface{}, less func(i, j int) bool)
- func StableSort(s []interface{}, less func(i, j int) bool)
- func Sti(slice interface{}) []interface{}
- func ToSet(s []interface{}) []interface{}
- func ToSetWith(slice []interface{}, equaller Equaller) []interface{}
- func Union(s1 []interface{}, s2 []interface{}) []interface{}
- func UnionWith(s1 []interface{}, s2 []interface{}, equaller Equaller) []interface{}
- type Equaller
- type SortSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains(slice []interface{}, value interface{}) bool
Contains checks whether the value is in the slice without Equaller.
func ContainsWith ¶
ContainsWith checks whether the value is in the slice with Equaller.
func Count ¶
func Count(slice []interface{}, value interface{}) int
Count returns the count of value in the slice without Equaller.
func Delete ¶
func Delete(slice []interface{}, value interface{}, n int) []interface{}
Delete deletes a value from slice for n times without Equaller.
func DeleteAll ¶
func DeleteAll(slice []interface{}, value interface{}) []interface{}
DeleteAll deletes a value from slice for all without Equaller.
func DeleteAllWith ¶
func DeleteAllWith(slice []interface{}, value interface{}, equaller Equaller) []interface{}
DeleteAllWith deletes a value from slice for all with Equaller.
func DeleteWith ¶
DeleteWith deletes a value from slice for n times with Equaller.
func Diff ¶
func Diff(s1 []interface{}, s2 []interface{}) []interface{}
Diff returns the difference of two slices without Equaller.
func DiffWith ¶
func DiffWith(s1 []interface{}, s2 []interface{}, equaller Equaller) []interface{}
DiffWith returns the difference of two slices with Equaller.
func Equal ¶
func Equal(s1 []interface{}, s2 []interface{}) bool
Equal checks two slice is equal in elements without Equaller.
func ForEach ¶
func ForEach(slice []interface{}, fn func(interface{}))
ForEach invokes function for each item in slice.
func GenerateByIndex ¶ added in v1.4.1
GenerateByIndex generates a slice by indies and a generate function.
func GoForEach ¶
func GoForEach(slice []interface{}, each func(interface{}))
GoForEach invokes a goroutine with a sync.WaitGroup, which invokes function for each item in slice.
func IndexOf ¶
func IndexOf(slice []interface{}, value interface{}) int
IndexOf returns the first index of value in the slice without Equaller.
func IndexOfWith ¶
IndexOfWith returns the first index of value in the slice with Equaller.
func Intersection ¶
func Intersection(s1 []interface{}, s2 []interface{}) []interface{}
Intersection returns the intersection of two slices without Equaller.
func IntersectionWith ¶
func IntersectionWith(s1 []interface{}, s2 []interface{}, equaller Equaller) []interface{}
IntersectionWith returns the intersection of two slices with Equaller.
func Its ¶
func Its(slice []interface{}, model interface{}) interface{}
Its means interface slice to slice. Example:
Its([]interface{}{0, 1}, 0).([]int) -> []int{0, 1}
func ItsOfFloat32 ¶
func ItsOfFloat32(slice []interface{}) []float32
func ItsOfFloat64 ¶
func ItsOfFloat64(slice []interface{}) []float64
func ItsOfInt16 ¶
func ItsOfInt16(slice []interface{}) []int16
func ItsOfInt32 ¶
func ItsOfInt32(slice []interface{}) []int32
func ItsOfInt64 ¶
func ItsOfInt64(slice []interface{}) []int64
func ItsOfString ¶
func ItsOfString(slice []interface{}) []string
func ItsOfUint16 ¶
func ItsOfUint16(slice []interface{}) []uint16
func ItsOfUint32 ¶
func ItsOfUint32(slice []interface{}) []uint32
func ItsOfUint64 ¶
func ItsOfUint64(slice []interface{}) []uint64
func ItsOfUint8 ¶
func ItsOfUint8(slice []interface{}) []uint8
func ItsToString ¶
func ItsToString(slice []interface{}) []string
func Map ¶
func Map(slice []interface{}, mapper func(interface{}) interface{}) []interface{}
Map maps a slice and return a new slice.
func ReverseNew ¶
func ReverseNew(slice []interface{}) []interface{}
ReverseNew reverse the old slice and return a new one.
func ReverseRange ¶ added in v1.4.1
ReverseRange generates an reverse integer slice from small to large with step.
func ShuffleNew ¶
func ShuffleNew(slice []interface{}) []interface{}
ShuffleNew shuffles the old slice and return a new one.
func StableSort ¶ added in v1.4.1
func Sti ¶
func Sti(slice interface{}) []interface{}
Sti means slice to interface slice. Example:
Sti([]int{0, 1}) -> []interface{}{0, 1}
func ToSet ¶
func ToSet(s []interface{}) []interface{}
ToSet removes the duplicate items in a slice as a set with Equaller.
func ToSetWith ¶
func ToSetWith(slice []interface{}, equaller Equaller) []interface{}
ToSetWith removes the duplicate items in a slice as a set with Equaller.
Types ¶
type Equaller ¶
type Equaller func(i, j interface{}) bool
Equaller represents how two data equal, used in XXXWith methods.
type SortSlice ¶ added in v1.4.1
type SortSlice struct {
// contains filtered or unexported fields
}