utils

package
v0.0.0-...-4257bbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2015 License: BSD-2-Clause Imports: 1 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL