wisski-cloud-distillery/internal/config/validators/duration.go
Tom Wiesing 945329a080
Move to yaml-based configuration
This commit updates the configuration to be yaml-based and updates the
configuration to read in a yaml file.
2023-02-25 09:14:56 +01:00

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
}