Documentation
¶
Index ¶
- func AppendIfNo(slice interface{}, targets ...interface{}) interface{}
- func AppendIfNoBool(slice []bool, targets ...bool) []bool
- func AppendIfNoInt(slice []int, targets ...int) []int
- func AppendIfNoInt16(slice []int16, targets ...int16) []int16
- func AppendIfNoInt32(slice []int32, targets ...int32) []int32
- func AppendIfNoInt64(slice []int64, targets ...int64) []int64
- func AppendIfNoInt8(slice []int8, targets ...int8) []int8
- func AppendIfNoInterface(slice []interface{}, targets ...interface{}) []interface{}
- func AppendIfNoString(slice []string, targets ...string) []string
- func AppendIfNoUint(slice []uint, targets ...uint) []uint
- func AppendIfNoUint16(slice []uint16, targets ...uint16) []uint16
- func AppendIfNoUint32(slice []uint32, targets ...uint32) []uint32
- func AppendIfNoUint64(slice []uint64, targets ...uint64) []uint64
- func AppendIfNoUint8(slice []uint8, targets ...uint8) []uint8
- func AppendIfNoValue(slice reflect.Value, targets ...interface{}) reflect.Value
- func Contains(length int, fun func(int) bool) bool
- func ContainsAllBool(slice []bool, targets ...bool) bool
- func ContainsAllGeneric(slice interface{}, targets ...interface{}) bool
- func ContainsAllInt(slice []int, targets ...int) bool
- func ContainsAllInt16(slice []int16, targets ...int16) bool
- func ContainsAllInt32(slice []int32, targets ...int32) bool
- func ContainsAllInt64(slice []int64, targets ...int64) bool
- func ContainsAllInt8(slice []int8, targets ...int8) bool
- func ContainsAllInterface(slice []interface{}, targets ...interface{}) bool
- func ContainsAllString(slice []string, targets ...string) bool
- func ContainsAllUint(slice []uint, targets ...uint) bool
- func ContainsAllUint16(slice []uint16, targets ...uint16) bool
- func ContainsAllUint32(slice []uint32, targets ...uint32) bool
- func ContainsAllUint64(slice []uint64, targets ...uint64) bool
- func ContainsAllUint8(slice []uint8, targets ...uint8) bool
- func ContainsAllValue(slice reflect.Value, targets ...interface{}) bool
- func ContainsAnyBool(slice []bool, targets ...bool) bool
- func ContainsAnyGeneric(slice interface{}, targets ...interface{}) bool
- func ContainsAnyInt(slice []int, targets ...int) bool
- func ContainsAnyInt16(slice []int16, targets ...int16) bool
- func ContainsAnyInt32(slice []int32, targets ...int32) bool
- func ContainsAnyInt64(slice []int64, targets ...int64) bool
- func ContainsAnyInt8(slice []int8, targets ...int8) bool
- func ContainsAnyInterface(slice []interface{}, targets ...interface{}) bool
- func ContainsAnyString(slice []string, targets ...string) bool
- func ContainsAnyUint(slice []uint, targets ...uint) bool
- func ContainsAnyUint16(slice []uint16, targets ...uint16) bool
- func ContainsAnyUint32(slice []uint32, targets ...uint32) bool
- func ContainsAnyUint64(slice []uint64, targets ...uint64) bool
- func ContainsAnyUint8(slice []uint8, targets ...uint8) bool
- func ContainsAnyValue(slice reflect.Value, targets ...interface{}) bool
- func ContainsBool(slice []bool, target bool) bool
- func ContainsGeneric(slice interface{}, target interface{}) bool
- func ContainsInt(slice []int, target int) bool
- func ContainsInt16(slice []int16, target int16) bool
- func ContainsInt32(slice []int32, target int32) bool
- func ContainsInt64(slice []int64, target int64) bool
- func ContainsInt8(slice []int8, target int8) bool
- func ContainsInterface(slice []interface{}, target interface{}) bool
- func ContainsString(slice []string, target string) bool
- func ContainsUint(slice []uint, target uint) bool
- func ContainsUint16(slice []uint16, target uint16) bool
- func ContainsUint32(slice []uint32, target uint32) bool
- func ContainsUint64(slice []uint64, target uint64) bool
- func ContainsUint8(slice []uint8, target uint8) bool
- func ContainsValue(slice reflect.Value, target interface{}) bool
- func Index(length int, fun func(int) bool) int
- func IndexBool(slice []bool, target bool) int
- func IndexGeneric(slice interface{}, target interface{}) int
- func IndexInt(slice []int, target int) int
- func IndexInt16(slice []int16, target int16) int
- func IndexInt32(slice []int32, target int32) int
- func IndexInt64(slice []int64, target int64) int
- func IndexInt8(slice []int8, target int8) int
- func IndexInterface(slice []interface{}, target interface{}) int
- func IndexString(slice []string, target string) int
- func IndexUint(slice []uint, target uint) int
- func IndexUint16(slice []uint16, target uint16) int
- func IndexUint32(slice []uint32, target uint32) int
- func IndexUint64(slice []uint64, target uint64) int
- func IndexUint8(slice []uint8, target uint8) int
- func IndexValue(slice reflect.Value, target interface{}) int
- func InsertBool(slice []bool, i int, value bool) []bool
- func InsertGeneric(slice interface{}, i int, value interface{}) interface{}
- func InsertInt(slice []int, i int, value int) []int
- func InsertInt16(slice []int16, i int, value int16) []int16
- func InsertInt32(slice []int32, i int, value int32) []int32
- func InsertInt64(slice []int64, i int, value int64) []int64
- func InsertInt8(slice []int8, i int, value int8) []int8
- func InsertInterface(slice []interface{}, i int, value interface{}) []interface{}
- func InsertString(slice []string, i int, value string) []string
- func InsertUint(slice []uint, i int, value uint) []uint
- func InsertUint16(slice []uint16, i int, value uint16) []uint16
- func InsertUint32(slice []uint32, i int, value uint32) []uint32
- func InsertUint64(slice []uint64, i int, value uint64) []uint64
- func InsertUint8(slice []uint8, i int, value uint8) []uint8
- func InsertValue(slice reflect.Value, i int, value reflect.Value) reflect.Value
- func IntersectBool(left, right []bool) []bool
- func IntersectGeneric(left, right interface{}) interface{}
- func IntersectInt(left, right []int) []int
- func IntersectInt16(left, right []int16) []int16
- func IntersectInt32(left, right []int32) []int32
- func IntersectInt64(left, right []int64) []int64
- func IntersectInt8(left, right []int8) []int8
- func IntersectInterface(left, right []interface{}) []interface{}
- func IntersectString(left, right []string) []string
- func IntersectUint(left, right []uint) []uint
- func IntersectUint16(left, right []uint16) []uint16
- func IntersectUint32(left, right []uint32) []uint32
- func IntersectUint64(left, right []uint64) []uint64
- func IntersectUint8(left, right []uint8) []uint8
- func IntersectValue(left, right reflect.Value) reflect.Value
- func LastIndex(length int, fun func(int) bool) int
- func LastIndexBool(slice []bool, target bool) int
- func LastIndexGeneric(slice interface{}, target interface{}) int
- func LastIndexInt(slice []int, target int) int
- func LastIndexInt16(slice []int16, target int16) int
- func LastIndexInt32(slice []int32, target int32) int
- func LastIndexInt64(slice []int64, target int64) int
- func LastIndexInt8(slice []int8, target int8) int
- func LastIndexInterface(slice []interface{}, target interface{}) int
- func LastIndexString(slice []string, target string) int
- func LastIndexUint(slice []uint, target uint) int
- func LastIndexUint16(slice []uint16, target uint16) int
- func LastIndexUint32(slice []uint32, target uint32) int
- func LastIndexUint64(slice []uint64, target uint64) int
- func LastIndexUint8(slice []uint8, target uint8) int
- func LastIndexValue(slice reflect.Value, target interface{}) int
- func MoveBackward(slice interface{}, i, n int) interface{}
- func Remove(slice interface{}, fun func(int) bool) interface{}
- func RemoveBool(slice []bool, targets ...bool) []bool
- func RemoveGeneric(slice interface{}, targets ...interface{}) interface{}
- func RemoveInt(slice []int, targets ...int) []int
- func RemoveInt16(slice []int16, targets ...int16) []int16
- func RemoveInt32(slice []int32, targets ...int32) []int32
- func RemoveInt64(slice []int64, targets ...int64) []int64
- func RemoveInt8(slice []int8, targets ...int8) []int8
- func RemoveInterface(slice []interface{}, targets ...interface{}) []interface{}
- func RemoveString(slice []string, targets ...string) []string
- func RemoveUint(slice []uint, targets ...uint) []uint
- func RemoveUint16(slice []uint16, targets ...uint16) []uint16
- func RemoveUint32(slice []uint32, targets ...uint32) []uint32
- func RemoveUint64(slice []uint64, targets ...uint64) []uint64
- func RemoveUint8(slice []uint8, targets ...uint8) []uint8
- func RemoveValue(slice reflect.Value, targets ...interface{}) interface{}
- func SplitBool(slice []bool, sep bool) (result [][]bool)
- func SplitGeneric(slice, sep interface{}) interface{}
- func SplitInt(slice []int, sep int) (result [][]int)
- func SplitInt16(slice []int16, sep int16) (result [][]int16)
- func SplitInt32(slice []int32, sep int32) (result [][]int32)
- func SplitInt64(slice []int64, sep int64) (result [][]int64)
- func SplitInt8(slice []int8, sep int8) (result [][]int8)
- func SplitInterface(slice []interface{}, sep interface{}) (result [][]interface{})
- func SplitString(slice []string, sep string) (result [][]string)
- func SplitUint(slice []uint, sep uint) (result [][]uint)
- func SplitUint16(slice []uint16, sep uint16) (result [][]uint16)
- func SplitUint32(slice []uint32, sep uint32) (result [][]uint32)
- func SplitUint64(slice []uint64, sep uint64) (result [][]uint64)
- func SplitUint8(slice []uint8, sep uint8) (result [][]uint8)
- func SplitValue(slice reflect.Value, sep interface{}) reflect.Value
- func SubstractBool(left, right []bool) []bool
- func SubstractGeneric(left, right interface{}) interface{}
- func SubstractInt(left, right []int) []int
- func SubstractInt16(left, right []int16) []int16
- func SubstractInt32(left, right []int32) []int32
- func SubstractInt64(left, right []int64) []int64
- func SubstractInt8(left, right []int8) []int8
- func SubstractInterface(left, right []interface{}) []interface{}
- func SubstractString(left, right []string) []string
- func SubstractUint(left, right []uint) []uint
- func SubstractUint16(left, right []uint16) []uint16
- func SubstractUint32(left, right []uint32) []uint32
- func SubstractUint64(left, right []uint64) []uint64
- func SubstractUint8(left, right []uint8) []uint8
- func SubstractValue(left, right reflect.Value) reflect.Value
- func UnionBool(left, right []bool) []bool
- func UnionGeneric(left, right interface{}) interface{}
- func UnionInt(left, right []int) []int
- func UnionInt16(left, right []int16) []int16
- func UnionInt32(left, right []int32) []int32
- func UnionInt64(left, right []int64) []int64
- func UnionInt8(left, right []int8) []int8
- func UnionInterface(left, right []interface{}) []interface{}
- func UnionString(left, right []string) []string
- func UnionUint(left, right []uint) []uint
- func UnionUint16(left, right []uint16) []uint16
- func UnionUint32(left, right []uint32) []uint32
- func UnionUint64(left, right []uint64) []uint64
- func UnionUint8(left, right []uint8) []uint8
- func UnionValue(left, right reflect.Value) reflect.Value
- func UniqueBool(slice []bool) []bool
- func UniqueBy(slice interface{}, keyFunc func(i int) interface{}, keepLast bool) interface{}
- func UniqueByValue(slice reflect.Value, keyFunc func(i int) interface{}, keepLast bool) reflect.Value
- func UniqueField(slice interface{}, fieldPaths ...string) (result []interface{})
- func UniqueFieldBool(slice interface{}, fieldPaths ...string) (result []bool)
- func UniqueFieldInt(slice interface{}, fieldPaths ...string) (result []int)
- func UniqueFieldInt16(slice interface{}, fieldPaths ...string) (result []int16)
- func UniqueFieldInt32(slice interface{}, fieldPaths ...string) (result []int32)
- func UniqueFieldInt64(slice interface{}, fieldPaths ...string) (result []int64)
- func UniqueFieldInt8(slice interface{}, fieldPaths ...string) (result []int8)
- func UniqueFieldString(slice interface{}, fieldPaths ...string) (result []string)
- func UniqueFieldUint(slice interface{}, fieldPaths ...string) (result []uint)
- func UniqueFieldUint16(slice interface{}, fieldPaths ...string) (result []uint16)
- func UniqueFieldUint32(slice interface{}, fieldPaths ...string) (result []uint32)
- func UniqueFieldUint64(slice interface{}, fieldPaths ...string) (result []uint64)
- func UniqueFieldUint8(slice interface{}, fieldPaths ...string) (result []uint8)
- func UniqueGeneric(slice interface{}) interface{}
- func UniqueInt(slice []int) []int
- func UniqueInt16(slice []int16) []int16
- func UniqueInt32(slice []int32) []int32
- func UniqueInt64(slice []int64) []int64
- func UniqueInt8(slice []int8) []int8
- func UniqueInterface(slice []interface{}) []interface{}
- func UniqueString(slice []string) []string
- func UniqueUint(slice []uint) []uint
- func UniqueUint16(slice []uint16) []uint16
- func UniqueUint32(slice []uint32) []uint32
- func UniqueUint64(slice []uint64) []uint64
- func UniqueUint8(slice []uint8) []uint8
- func UniqueValue(slice reflect.Value) reflect.Value
Examples ¶
- AppendIfNo
- AppendIfNoBool
- AppendIfNoInt
- AppendIfNoInt16
- AppendIfNoInt32
- AppendIfNoInt64
- AppendIfNoInt8
- AppendIfNoInterface
- AppendIfNoString
- AppendIfNoUint
- AppendIfNoUint16
- AppendIfNoUint32
- AppendIfNoUint64
- AppendIfNoUint8
- AppendIfNoValue
- Contains
- ContainsAllBool
- ContainsAllGeneric
- ContainsAllInt
- ContainsAllInt16
- ContainsAllInt32
- ContainsAllInt64
- ContainsAllInt8
- ContainsAllInterface
- ContainsAllString
- ContainsAllUint
- ContainsAllUint16
- ContainsAllUint32
- ContainsAllUint64
- ContainsAllUint8
- ContainsAllValue
- ContainsAnyBool
- ContainsAnyGeneric
- ContainsAnyInt
- ContainsAnyInt16
- ContainsAnyInt32
- ContainsAnyInt64
- ContainsAnyInt8
- ContainsAnyInterface
- ContainsAnyString
- ContainsAnyUint
- ContainsAnyUint16
- ContainsAnyUint32
- ContainsAnyUint64
- ContainsAnyUint8
- ContainsAnyValue
- ContainsBool
- ContainsGeneric
- ContainsInt
- ContainsInt16
- ContainsInt32
- ContainsInt64
- ContainsInt8
- ContainsInterface
- ContainsString
- ContainsUint
- ContainsUint16
- ContainsUint32
- ContainsUint64
- ContainsUint8
- ContainsValue
- Index
- IndexBool
- IndexGeneric
- IndexInt
- IndexInt16
- IndexInt32
- IndexInt64
- IndexInt8
- IndexInterface
- IndexString
- IndexUint
- IndexUint16
- IndexUint32
- IndexUint64
- IndexUint8
- IndexValue
- InsertBool
- InsertGeneric
- InsertInt
- InsertInt16
- InsertInt32
- InsertInt64
- InsertInt8
- InsertInterface
- InsertString
- InsertUint
- InsertUint16
- InsertUint32
- InsertUint64
- InsertUint8
- InsertValue
- IntersectBool
- IntersectGeneric
- IntersectInt
- IntersectInt16
- IntersectInt32
- IntersectInt64
- IntersectInt8
- IntersectInterface
- IntersectString
- IntersectUint
- IntersectUint16
- IntersectUint32
- IntersectUint64
- IntersectUint8
- IntersectValue
- LastIndex
- LastIndexBool
- LastIndexGeneric
- LastIndexInt
- LastIndexInt16
- LastIndexInt32
- LastIndexInt64
- LastIndexInt8
- LastIndexInterface
- LastIndexString
- LastIndexUint
- LastIndexUint16
- LastIndexUint32
- LastIndexUint64
- LastIndexUint8
- LastIndexValue
- MoveBackward
- Remove
- RemoveBool
- RemoveGeneric
- RemoveInt
- RemoveInt16
- RemoveInt32
- RemoveInt64
- RemoveInt8
- RemoveInterface
- RemoveString
- RemoveUint
- RemoveUint16
- RemoveUint32
- RemoveUint64
- RemoveUint8
- RemoveValue
- SplitBool
- SplitGeneric
- SplitInt
- SplitInt16
- SplitInt32
- SplitInt64
- SplitInt8
- SplitInterface
- SplitString
- SplitUint
- SplitUint16
- SplitUint32
- SplitUint64
- SplitUint8
- SplitValue
- SubstractBool
- SubstractGeneric
- SubstractInt
- SubstractInt16
- SubstractInt32
- SubstractInt64
- SubstractInt8
- SubstractInterface
- SubstractString
- SubstractUint
- SubstractUint16
- SubstractUint32
- SubstractUint64
- SubstractUint8
- SubstractValue
- UnionBool
- UnionGeneric
- UnionInt
- UnionInt16
- UnionInt32
- UnionInt64
- UnionInt8
- UnionInterface
- UnionString
- UnionUint
- UnionUint16
- UnionUint32
- UnionUint64
- UnionUint8
- UnionValue
- UniqueBool
- UniqueBy
- UniqueBy (KeepLast)
- UniqueField
- UniqueFieldBool
- UniqueFieldInt
- UniqueFieldInt16
- UniqueFieldInt32
- UniqueFieldInt64
- UniqueFieldInt8
- UniqueFieldString
- UniqueFieldUint
- UniqueFieldUint16
- UniqueFieldUint32
- UniqueFieldUint64
- UniqueFieldUint8
- UniqueGeneric
- UniqueInt
- UniqueInt16
- UniqueInt32
- UniqueInt64
- UniqueInt8
- UniqueInterface
- UniqueString
- UniqueUint
- UniqueUint16
- UniqueUint32
- UniqueUint64
- UniqueUint8
- UniqueValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIfNo ¶
func AppendIfNo(slice interface{}, targets ...interface{}) interface{}
AppendIfNo append value in targets to slice if slice has no this value.
Example ¶
Output: [{3 c} {0 } {2 b} {0 } {9 f}] [{3 c} {0 } {2 b} {0 } {9 f}] [{3 c} {0 } {2 b} {0 } {9 f} {4 d}]
func AppendIfNoBool ¶
Example ¶
Output: [true] [true false] [true true false]
func AppendIfNoInt ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoInt16 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoInt32 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoInt64 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoInt8 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoInterface ¶
func AppendIfNoInterface(slice []interface{}, targets ...interface{}) []interface{}
Example ¶
Output: [3 c false 2 b] [3 c false 2 b] [3 c false 2 b 4 d]
func AppendIfNoString ¶
Example ¶
Output: [a] [a b] [a b c]
func AppendIfNoUint ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoUint16 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoUint32 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoUint64 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoUint8 ¶
Example ¶
Output: [1] [1 2] [1 2 3]
func AppendIfNoValue ¶
Example ¶
Output: [{3 c} {0 } {2 b} {0 } {9 f}] [{3 c} {0 } {2 b} {0 } {9 f}] [{3 c} {0 } {2 b} {0 } {9 f} {4 d}]
func ContainsAllBool ¶
Example ¶
Output: true true true false false
func ContainsAllGeneric ¶
func ContainsAllGeneric(slice interface{}, targets ...interface{}) bool
Example ¶
Output: true false true false true true true false false
func ContainsAllInt ¶
Example ¶
Output: true true true false false
func ContainsAllInt16 ¶
Example ¶
Output: true true true false false
func ContainsAllInt32 ¶
Example ¶
Output: true true true false false
func ContainsAllInt64 ¶
Example ¶
Output: true true true false false
func ContainsAllInt8 ¶
Example ¶
Output: true true true false false
func ContainsAllInterface ¶
func ContainsAllInterface(slice []interface{}, targets ...interface{}) bool
Example ¶
Output: true false
func ContainsAllString ¶
Example ¶
Output: true true true false false
func ContainsAllUint ¶
Example ¶
Output: true true true false false
func ContainsAllUint16 ¶
Example ¶
Output: true true true false false
func ContainsAllUint32 ¶
Example ¶
Output: true true true false false
func ContainsAllUint64 ¶
Example ¶
Output: true true true false false
func ContainsAllUint8 ¶
Example ¶
Output: true true true false false
func ContainsAllValue ¶
Example ¶
Output: true false false
func ContainsAnyBool ¶
Example ¶
Output: false false false false true
func ContainsAnyGeneric ¶
func ContainsAnyGeneric(slice interface{}, targets ...interface{}) bool
Example ¶
Output: false false false false false true true true false
func ContainsAnyInt ¶
Example ¶
Output: false false false true false
func ContainsAnyInt16 ¶
Example ¶
Output: false false false true false
func ContainsAnyInt32 ¶
Example ¶
Output: false false false true false
func ContainsAnyInt64 ¶
Example ¶
Output: false false false true false
func ContainsAnyInt8 ¶
Example ¶
Output: false false false true false
func ContainsAnyInterface ¶
func ContainsAnyInterface(slice []interface{}, targets ...interface{}) bool
Example ¶
Output: false true true false
func ContainsAnyString ¶
Example ¶
Output: false false false false true
func ContainsAnyUint ¶
Example ¶
Output: false false false true false
func ContainsAnyUint16 ¶
Example ¶
Output: false false false true false
func ContainsAnyUint32 ¶
Example ¶
Output: false false false true false
func ContainsAnyUint64 ¶
Example ¶
Output: false false false true false
func ContainsAnyUint8 ¶
Example ¶
Output: false false false true false
func ContainsAnyValue ¶
Example ¶
Output: false true true false
func ContainsBool ¶
Example ¶
Output: true true false
func ContainsGeneric ¶
func ContainsGeneric(slice interface{}, target interface{}) bool
Example ¶
Output: false true true false false
func ContainsInt16 ¶
Example ¶
Output: true false
func ContainsInt32 ¶
Example ¶
Output: true false
func ContainsInt64 ¶
Example ¶
Output: true false
func ContainsInterface ¶
func ContainsInterface(slice []interface{}, target interface{}) bool
Example ¶
Output: true false
func ContainsString ¶
Example ¶
Output: true false
func ContainsUint16 ¶
Example ¶
Output: true false
func ContainsUint32 ¶
Example ¶
Output: true false
func ContainsUint64 ¶
Example ¶
Output: true false
func ContainsUint8 ¶
Example ¶
Output: true false
func ContainsValue ¶
Example ¶
Output: true false false
func IndexGeneric ¶
func IndexGeneric(slice interface{}, target interface{}) int
Example ¶
Output: -1 -1 -1 -1 2
func IndexInterface ¶
func IndexInterface(slice []interface{}, target interface{}) int
Example ¶
Output: -1 -1 -1 0 2
func IndexValue ¶
Example ¶
Output: -1 -1 -1 2
func InsertBool ¶
InsertBool insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [true] [true] [true false true] [false true true] [false true true]
func InsertGeneric ¶
func InsertGeneric(slice interface{}, i int, value interface{}) interface{}
Insert insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [a] [a] [a b c] [b a c] [b c a]
func InsertInt ¶
InsertInt insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertInt16 ¶
InsertInt16 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertInt32 ¶
InsertInt32 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertInt64 ¶
InsertInt64 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertInt8 ¶
InsertInt8 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertInterface ¶
func InsertInterface(slice []interface{}, i int, value interface{}) []interface{}
InsertInterface insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [a] [a] [a b 1] [b a 1] [b 1 a]
func InsertString ¶
InsertString insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [a] [a] [a b c] [b a c] [b c a]
func InsertUint ¶
InsertUint insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertUint16 ¶
InsertUint16 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertUint32 ¶
InsertUint32 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertUint64 ¶
InsertUint64 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertUint8 ¶
InsertUint8 insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [3] [3] [1 2 3] [2 1 3] [2 3 1]
func InsertValue ¶
InsertValue insert value at index i, it panics if i > len(slice). The input slice will be modified.
Example ¶
Output: [a] [a] [a b c] [b a c] [b c a]
func IntersectBool ¶
IntersectBool returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [true false true] [true true] []
func IntersectGeneric ¶
func IntersectGeneric(left, right interface{}) interface{}
IntersectGeneric returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: <nil> []slice.T(nil) [{0 } {2 b} {2 b}]
func IntersectInt ¶
IntersectInt returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectInt16 ¶
IntersectInt16 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectInt32 ¶
IntersectInt32 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectInt64 ¶
IntersectInt64 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectInt8 ¶
IntersectInt8 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectInterface ¶
func IntersectInterface(left, right []interface{}) []interface{}
IntersectInterface returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 1 2] [] []
func IntersectString ¶
IntersectString returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [a b b] [] []
func IntersectUint ¶
IntersectUint returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectUint16 ¶
IntersectUint16 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectUint32 ¶
IntersectUint32 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectUint64 ¶
IntersectUint64 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectUint8 ¶
IntersectUint8 returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [1 2 2] [] []
func IntersectValue ¶
IntersectValue returns intersection of left and right, in the left order. The duplicate members in left are kept.
Example ¶
Output: [] []slice.T(nil) [{0 } {2 b} {2 b}]
func LastIndexGeneric ¶
func LastIndexGeneric(slice interface{}, target interface{}) int
Example ¶
Output: -1 3 -1
func LastIndexInterface ¶
func LastIndexInterface(slice []interface{}, target interface{}) int
Example ¶
Output: 3 -1
func LastIndexString ¶
Example ¶
Output: 3 -1
func LastIndexUint16 ¶
Example ¶
Output: 3 -1
func LastIndexUint32 ¶
Example ¶
Output: 3 -1
func LastIndexUint64 ¶
Example ¶
Output: 3 -1
func LastIndexValue ¶
Example ¶
Output: -1 3 -1
func MoveBackward ¶
func MoveBackward(slice interface{}, i, n int) interface{}
MoveBackward move elements starting at i backward n steps. It panics if i > len(slice) The input slice will be modified.
Example ¶
Output: [0 0 0] [0 4 5 0 4 5] [0 4 5 0 4 5] [0 4 5 0 0 5] [0 4 5 0 0 0]
func RemoveBool ¶
Example ¶
Output: [] [true false false true] [true true] []
func RemoveGeneric ¶
func RemoveGeneric(slice interface{}, targets ...interface{}) interface{}
Example ¶
Output: [1 2 2 3] [1 3]
func RemoveInt16 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveInt32 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveInt64 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveInt8 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveInterface ¶
func RemoveInterface(slice []interface{}, targets ...interface{}) []interface{}
Example ¶
Output: [1 2 2 c] [1 c] [c]
func RemoveString ¶
Example ¶
Output: [a b b c] [a c] [c]
func RemoveUint ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveUint16 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveUint32 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveUint64 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveUint8 ¶
Example ¶
Output: [1 2 2 3] [1 3] [3]
func RemoveValue ¶
Example ¶
Output: [2 2]
func SplitBool ¶
Example ¶
Output: [] [[] []] [[true]] [[true true]] [[true true] []] [[true true] [true]] [[true true] [true true]] [[true true] [true true] []]
func SplitGeneric ¶
func SplitGeneric(slice, sep interface{}) interface{}
Example ¶
Output: [] [[] []] [[{1 a}]] [[{1 a} {2 b}]] [[{1 a} {2 b}] []] [[{1 a} {2 b}] [{3 c}]] [[{1 a} {2 b}] [{3 c} {4 d}]] [[{1 a} {2 b}] [{3 c} {4 d}] []]
func SplitInt ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitInt16 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitInt32 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitInt64 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitInt8 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitInterface ¶
func SplitInterface(slice []interface{}, sep interface{}) (result [][]interface{})
Example ¶
Output: [] [[] []] [[a]] [[a 1]] [[a 1] []] [[a 1] [c]] [[a 1] [c 3]] [[a 1] [c 3] []]
func SplitString ¶
Example ¶
Output: [] [[] []] [[a]] [[a b]] [[a b] []] [[a b] [c]] [[a b] [c d]] [[a b] [c d] []]
func SplitUint ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitUint16 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitUint32 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitUint64 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitUint8 ¶
Example ¶
Output: [] [[] []] [[1]] [[1 2]] [[1 2] []] [[1 2] [3]] [[1 2] [3 4]] [[1 2] [3 4] []]
func SplitValue ¶
Example ¶
Output: [] [[] []] [[{1 a}]] [[{1 a} {2 b}]] [[{1 a} {2 b}] []] [[{1 a} {2 b}] [{3 c}]] [[{1 a} {2 b}] [{3 c} {4 d}]] [[{1 a} {2 b}] [{3 c} {4 d}] []]
func SubstractBool ¶
SubstractBool substracts right from left.
Example ¶
Output: [] [true true] [] [true false true] [false]
func SubstractGeneric ¶
func SubstractGeneric(left, right interface{}) interface{}
Substract substracts right from left.
Example ¶
Output: <nil> [] [{3 c} {0 } {2 b} {9 f} {3 c}] [{3 c} {9 f} {3 c}]
func SubstractInt ¶
SubstractInt substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractInt16 ¶
SubstractInt16 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractInt32 ¶
SubstractInt32 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractInt64 ¶
SubstractInt64 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractInt8 ¶
SubstractInt8 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractInterface ¶
func SubstractInterface(left, right []interface{}) []interface{}
SubstractInterface substracts right from left.
Example ¶
Output: [] [a 3 a] [b] [a b 3 a] [a b 3 a]
func SubstractString ¶
SubstractString substracts right from left.
Example ¶
Output: [] [a c a] [b] [a b c a] [a b c a]
func SubstractUint ¶
SubstractUint substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractUint16 ¶
SubstractUint16 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractUint32 ¶
SubstractUint32 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractUint64 ¶
SubstractUint64 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractUint8 ¶
SubstractUint8 substracts right from left.
Example ¶
Output: [] [1 3 1] [2] [1 2 3 1] [1 2 3 1]
func SubstractValue ¶
SubstractValue substracts right from left.
Example ¶
Output: [] [{3 c} {0 } {2 b} {9 f} {3 c}] [{3 c} {9 f} {3 c}]
func UnionBool ¶
UnionBool returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [true false true] [true true false]
func UnionGeneric ¶
func UnionGeneric(left, right interface{}) interface{}
UnionGeneric returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: <nil> [{3 c} {0 } {2 b} {9 f} {2 b}] [{3 c}] [{3 c} {0 } {2 b} {9 f} {2 b}] [{3 c} {0 } {2 b} {9 f} {2 b} {4 d}]
func UnionInt ¶
UnionInt returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionInt16 ¶
UnionInt16 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionInt32 ¶
UnionInt32 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionInt64 ¶
UnionInt64 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionInt8 ¶
UnionInt8 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionInterface ¶
func UnionInterface(left, right []interface{}) []interface{}
UnionInterface returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4 4]
func UnionString ¶
UnionString returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionUint ¶
UnionUint returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionUint16 ¶
UnionUint16 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionUint32 ¶
UnionUint32 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionUint64 ¶
UnionUint64 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionUint8 ¶
UnionUint8 returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: [1 2 2 3 4]
func UnionValue ¶
UnionValue returns union set of left and right, with right follows left. The duplicate members in left are kept.
Example ¶
Output: false
func UniqueBy ¶
UniqueBy will change the original slice, Use copy to keep the original slice. The input slice will be modified. If param keepLast is true, the last one of the same elements is kept, otherwise the first one is kept.
Example ¶
Output: [] [{1 a} {2 a}]
Example (KeepLast) ¶
Output: [] [{1 b} {2 b}]
func UniqueByValue ¶
func UniqueByValue(slice reflect.Value, keyFunc func(i int) interface{}, keepLast bool) reflect.Value
UniqueByValue will change the original slice, Use copy to keep the original slice. The input slice will be modified. If param keepLast is true, the last one of the same elements is kept, otherwise the first one is kept.
func UniqueField ¶
func UniqueField(slice interface{}, fieldPaths ...string) (result []interface{})
UniqueField returns unique values of field from a struct slice
Example ¶
Output: [1 2 3] [a b c]
func UniqueFieldBool ¶
UniqueFieldBool returns unique values of field from a struct slice
Example ¶
Output: [true]
func UniqueFieldInt ¶
UniqueFieldInt returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldInt16 ¶
UniqueFieldInt16 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldInt32 ¶
UniqueFieldInt32 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldInt64 ¶
UniqueFieldInt64 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldInt8 ¶
UniqueFieldInt8 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldString ¶
UniqueFieldString returns unique values of field from a struct slice
Example ¶
Output: [a b c]
func UniqueFieldUint ¶
UniqueFieldUint returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldUint16 ¶
UniqueFieldUint16 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldUint32 ¶
UniqueFieldUint32 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldUint64 ¶
UniqueFieldUint64 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueFieldUint8 ¶
UniqueFieldUint8 returns unique values of field from a struct slice
Example ¶
Output: [1 2 3]
func UniqueGeneric ¶
func UniqueGeneric(slice interface{}) interface{}
Input slice will be modified.
Example ¶
Output: [{1 a} {2 b} {0 } {3 c}]
func UniqueInterface ¶
func UniqueInterface(slice []interface{}) []interface{}
Input slice will be modified.
Example ¶
Output: [0 1 2 true 4]
Types ¶
This section is empty.