This commit updates the configuration to be yaml-based and updates the configuration to read in a yaml file.
14 lines
216 B
Go
14 lines
216 B
Go
package validators
|
|
|
|
import "time"
|
|
|
|
func ValidateDuration(d *time.Duration, dflt string) error {
|
|
if *d == 0 {
|
|
var err error
|
|
*d, err = time.ParseDuration(dflt)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|