util/time: ParseDuration fix
All checks were successful
lint / lint (pull_request) Successful in 1m0s
pr / test (pull_request) Successful in 58s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-05-29 13:59:30 +03:00
parent ce125b77c1
commit 9b3bccd1f1
2 changed files with 10 additions and 3 deletions

View File

@@ -21,7 +21,6 @@ loop:
for i, r := range s {
switch r {
case 's', 'm':
p = i
break loop
case 'h':
d, err := strconv.Atoi(s[p:i])
@@ -68,7 +67,7 @@ func (d *Duration) UnmarshalJSON(b []byte) error {
*d = Duration(time.Duration(value))
return nil
case string:
dv, err := time.ParseDuration(value)
dv, err := ParseDuration(value)
if err != nil {
return err
}