util/strutil: do not panic on wrong duration unit.

This commit is contained in:
Fabian Reinartz 2015-06-04 12:02:26 +02:00
parent f344ecba59
commit 183be62f2a
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ func StringToDuration(durationStr string) (duration time.Duration, err error) {
case "s": case "s":
duration *= 1 duration *= 1
default: default:
panic("Invalid time unit in duration string.") return 0, fmt.Errorf("invalid time unit in duration string: %q", unit)
} }
return return
} }