Comparing 2 time.Duration values in go with math.Min
errs :
cannot use someTime (type time.Duration) as type float64 in argument to math.Min
I could use an if else statement to get the min duration, but is there a native min function for getting the min duration?
There's nothing in the standard library, but it's simple to write yourself.
func minDuration(a, b time.Duration) time.Duration {
if a <= b { return a }
return b
}