🔨 Refactor 'Responses' type and its methods

This commit is contained in:
2025-08-17 19:30:26 +04:00
parent 7930be490d
commit ffa724fae7
4 changed files with 33 additions and 48 deletions

View File

@@ -1,6 +1,7 @@
package types
import (
"slices"
"sort"
"time"
)
@@ -14,9 +15,7 @@ func (d Durations) Sort(ascending ...bool) {
return d[i] > d[j]
})
} else { // Otherwise, sort in ascending order
sort.Slice(d, func(i, j int) bool {
return d[i] < d[j]
})
slices.Sort(d)
}
}