/unique

Package unique provides primitives for sorting slices removing repeated elements.

Primary LanguageGoApache License 2.0Apache-2.0

GoDoc Build Status

unique

Package unique provides primitives for sorting slices removing repeated elements.

a quick example

Executing this code:

	s := []int{3, 5, 1, 7, 2, 3, 7, 5, 2}
	less := func(i, j int) bool { return s[i] < s[j] }
	unique.Slice(&s, less)
	fmt.Println(s)

Will output the following:

[1 2 3 5 7]