init code
This commit is contained in:
1 parent
a7559b3f9d
commit
92a63c7885
43 files changed
+1115
No files matched your search
@@ -0,0 +1,9 @@
|
||||
package slicex
|
||||
|
||||
import "sort"
|
||||
|
||||
func Sort[T any](slice []T, compareTo func(o1, o2 T) bool) {
|
||||
sort.Slice(slice, func(i, j int) bool {
|
||||
return compareTo(slice[i], slice[j])
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user