mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-09-27 03:15:55 +08:00
14 lines
168 B
Go
14 lines
168 B
Go
package slicex
|
|
|
|
import "fmt"
|
|
|
|
func ExampleUnique() {
|
|
slice := []int{1, 2, 3, 2, 4, 4, 5}
|
|
res := Unique(slice)
|
|
|
|
fmt.Printf("%+v", res)
|
|
|
|
// Output:
|
|
// [1 2 3 4 5]
|
|
}
|