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:
parent
e891c33e40
commit
7f30a5e6e7
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user