mirror of
https://github.com/aykhans/sarin.git
synced 2026-10-17 14:53:52 +00:00
🔨 Refactor 'Responses' type and its methods
This commit is contained in:
1 parent
7930be490d
commit
ffa724fae7
4 files changed
+33
-48
No files matched your search
+2
-3
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user