Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntComparator ¶
func IntComparator(a, b interface{}) int
func Sort ¶
func Sort(values []interface{}, comparator Comparator)
Sorts values (in-place) using timsort
func StringComparator ¶
func StringComparator(a, b interface{}) int
Types ¶
type Comparator ¶
type Comparator func(a, b interface{}) int
Comparator will make type assertion (see IntComparator for example), which will panic if a or b are not of the asserted type.
Should return:
-1, if a < b 0, if a == b 1, if a > b
Click to show internal directories.
Click to hide internal directories.