Files
mostlymatter/vendor/github.com/splitio/go-toolkit/v4/common/timeutil.go
Joram Wilander aba00a3cfd Update split SDK to 6.0.2 to fix sync bug (#17060)
* Update split SDK to 6.0.2 to fix sync bug

* Vendor and tidy
2021-03-04 11:16:08 -05:00

26 строки
474 B
Go

package common
import "time"
// MinDuration returns the min duration among them
func MinDuration(d1, d2 time.Duration, ds ...time.Duration) time.Duration {
min := d1
for _, d := range append(ds, d2) {
if d < min {
min = d
}
}
return min
}
// MaxDuration returns the max duration among them
func MaxDuration(d1, d2 time.Duration, ds ...time.Duration) time.Duration {
max := d1
for _, d := range append(ds, d2) {
if d > max {
max = d
}
}
return max
}