You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
223 B
Go
19 lines
223 B
Go
5 years ago
|
package timex
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
// Max returns the maximum duration
|
||
|
func Max(values ...time.Duration) time.Duration {
|
||
|
var (
|
||
|
max time.Duration
|
||
|
)
|
||
|
|
||
|
for _, v := range values {
|
||
|
if v > max {
|
||
|
max = v
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return max
|
||
|
}
|