Documentation
¶
Index ¶
- func Difference(arrs ...interface{}) (reflect.Value, bool)
- func DifferenceString(args ...[]string) []stringdeprecated
- func DifferenceStringArr(arr [][]string) []stringdeprecated
- func DifferenceUint64(args ...[]uint64) []uint64deprecated
- func DifferenceUint64Arr(arr [][]uint64) []uint64deprecated
- func Distinct(arr interface{}) (reflect.Value, bool)
- func DistinctIntersectUint64(args ...[]uint64) []uint64deprecated
- func DistinctIntersectUint64Arr(arr [][]uint64) []uint64deprecated
- func DistinctString(arg []string) []stringdeprecated
- func DistinctUint64(arg []uint64) []uint64deprecated
- func Intersect(arrs ...interface{}) (reflect.Value, bool)
- func IntersectString(args ...[]string) []stringdeprecated
- func IntersectStringArr(arr [][]string) []stringdeprecated
- func IntersectUint64(args ...[]uint64) []uint64deprecated
- func IntersectUint64Arr(arr [][]uint64) []uint64deprecated
- func SortedIntersectUint64(args ...[]uint64) []uint64deprecated
- func SortedIntersectUint64Arr(arr [][]uint64) []uint64deprecated
- func Union(arrs ...interface{}) (reflect.Value, bool)
- func UnionString(args ...[]string) []stringdeprecated
- func UnionStringArr(arr [][]string) []stringdeprecated
- func UnionUint64(args ...[]uint64) []uint64deprecated
- func UnionUint64Arr(arr [][]uint64) []uint64deprecated
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
Difference returns a slice of values that are only present in one of the input slices
[1, 2, 2, 4, 6] & [2, 4, 5] >> [1, 5, 6]
[1, 1, 3, 4, 5, 6] >> [1, 3, 4, 5, 6]
Example ¶
var a = []int{1, 1, 2, 3} var b = []int{2, 4} z, ok := Difference(a, b) if !ok { fmt.Println("Cannot find difference") } slice, ok := z.Interface().([]int) if !ok { fmt.Println("Cannot convert to slice") } fmt.Println(slice, reflect.TypeOf(slice)) // [1, 3] []int
func DifferenceString
deprecated
func DifferenceStringArr
deprecated
func DifferenceUint64
deprecated
func DifferenceUint64Arr
deprecated
func Distinct ¶
Distinct returns the unique vals of a slice
[1, 1, 2, 3] >> [1, 2, 3]
Example ¶
Examples
var a = []int{1, 1, 2, 3} z, ok := Distinct(a) if !ok { fmt.Println("Cannot find distinct") } slice, ok := z.Interface().([]int) if !ok { fmt.Println("Cannot convert to slice") } fmt.Println(slice, reflect.TypeOf(slice)) // [1, 2, 3] []int
func DistinctIntersectUint64
deprecated
func DistinctIntersectUint64Arr
deprecated
func DistinctString
deprecated
func DistinctUint64
deprecated
func Intersect ¶
Intersect returns a slice of values that are present in all of the input slices
[1, 1, 3, 4, 5, 6] & [2, 3, 6] >> [3, 6]
[1, 1, 3, 4, 5, 6] >> [1, 3, 4, 5, 6]
Example ¶
var a = []int{1, 1, 2, 3} var b = []int{2, 4} z, ok := Intersect(a, b) if !ok { fmt.Println("Cannot find intersect") } slice, ok := z.Interface().([]int) if !ok { fmt.Println("Cannot convert to slice") } fmt.Println(slice, reflect.TypeOf(slice)) // [2] []int
func IntersectString
deprecated
func IntersectStringArr
deprecated
func IntersectUint64
deprecated
func IntersectUint64Arr
deprecated
func SortedIntersectUint64
deprecated
func SortedIntersectUint64Arr
deprecated
func Union ¶
Union returns a slice that contains the unique values of all the input slices
[1, 2, 2, 4, 6] & [2, 4, 5] >> [1, 2, 4, 5, 6]
[1, 1, 3, 4, 5, 6] >> [1, 3, 4, 5, 6]
Example ¶
var a = []int{1, 1, 2, 3} var b = []int{2, 4} z, ok := Union(a, b) if !ok { fmt.Println("Cannot find union") } slice, ok := z.Interface().([]int) if !ok { fmt.Println("Cannot convert to slice") } fmt.Println(slice, reflect.TypeOf(slice)) // [1, 2, 3, 4] []int
func UnionString
deprecated
func UnionStringArr
deprecated
func UnionUint64
deprecated
func UnionUint64Arr
deprecated
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.