config: do not handle "" durations (and do not error)

They should not be interpreted as 0, since that may overwrite
defaults which are not 0. We simply need to do nothing.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This commit is contained in:
Hector Sanjuan 2019-01-12 18:40:00 +01:00
parent e891c33e40
commit 7f30a5e6e7

View File

@ -97,7 +97,8 @@ type DurationOpt struct {
func ParseDurations(component string, args ...*DurationOpt) error {
for _, arg := range args {
if arg.Duration == "" {
*arg.Dst = 0
// don't do anything. Let the destination field
// stay at its default.
continue
}
t, err := time.ParseDuration(arg.Duration)