Documentation ¶
Overview ¶
package slice
package slice
package set
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Distinct ¶
func Distinct(v interface{}, key func(i int) interface{})
Distinct distinct elem in array
func NewIntegerSet ¶
func NewIntegerSet(s Integer) integerSet
Types ¶
type Integer ¶
type Integer []int
func (Integer) Distinct ¶
Distinct distinct elem in slice only keep different elem in slice it will keep order of origin WARNING: this method will change origin slice sort and return it
Example:
Integer([]int{2,2,1,3}).Distinct()
>>> []int{2,1,3} origin slice: []int{2,1,3}
Click to show internal directories.
Click to hide internal directories.