* Add feature flag managment system using split.io and remove viper. * Fixing tests. * Attempt to fix postgres tests. * Fix watch filepath for advanced logging. * Review fixes. * Some error wrapping. * Remove unessisary store interface. * Desanitize SplitKey * Simplify. * Review feedback. * Rename split mlog adatper to split logger. * fsInner * Style. * Restore oldcfg test. * Downgrading non-actionable feature flag errors to warnings. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
26 строки
474 B
Go
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
|
|
}
|