github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/slice/sort/asc/api.go (about) 1 // Package asc provides aliases for storing slice functions. 2 package asc 3 4 import ( 5 "golang.org/x/exp/constraints" 6 7 "github.com/m4gshm/gollections/slice/sort" 8 ) 9 10 // Of is a short alias for sort.By 11 func Of[T any, O constraints.Ordered, TS ~[]T](elements TS, orderConverner func(T) O) TS { 12 return sort.By(elements, orderConverner) 13 }