Replace experimental maps and slices with stdlib
This commit is contained in:
parent
68a8650297
commit
aa8eb1af6e
5 changed files with 16 additions and 17 deletions
|
@ -1,10 +1,9 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"net/url"
|
||||
"sort"
|
||||
|
||||
"golang.org/x/exp/constraints"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -357,7 +356,7 @@ func sortByName[T orderedWithName](direction string, results []T) {
|
|||
})
|
||||
}
|
||||
|
||||
func sortByFunc[T orderedWithName, U constraints.Ordered](direction string, results []T, fn func(int) U) {
|
||||
func sortByFunc[T orderedWithName, U cmp.Ordered](direction string, results []T, fn func(int) U) {
|
||||
// Ascending
|
||||
if direction == ascendantSorting {
|
||||
sort.Slice(results, func(i, j int) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue