sort: sorting algorithms and support for sorted data structures The sort module provides functions for sorting slices, as well as operations on sorted slices, such as binary search. The functions [[sort]] and [[search]] are provided for working with generic slices. In order to work with a user-supplied slice of an arbitrary type, the slice must be cast to []opaque and the size of the member type passed alongside it (e.g. size(int)). The functions also take in a [[cmpfunc]] argument, which is called to determine how the slice items should be ordered.