Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asc ¶
func Asc[T constraints.Ordered](slices []T)
func Desc ¶
func Desc[T constraints.Ordered](slices []T)
func SortableAsc ¶
func SortableAsc[T Sortable[T]](slices []T)
SortableAsc is a function that takes in a slice of type T and sorts it in ascending order. The type T must implement the Sortable interface, which requires the Less() method to be defined. The function uses the sort.Slice() method from the sort package to sort the slice, using a comparison function that compares two elements of the slice using their Less() methods.
func SortableDesc ¶
func SortableDesc[T Sortable[T]](slices []T)
SortableDesc is a function that takes in a slice of type T, where T is a type that implements the Sortable interface. The function sorts the slice in descending order using the Less method from the Sortable interface.
Types ¶
Click to show internal directories.
Click to hide internal directories.