diff --git a/util/format.go b/util/format.go index 5f1db3422..71811b5ac 100644 --- a/util/format.go +++ b/util/format.go @@ -4,6 +4,7 @@ import ( "fmt" "regexp" "strings" + "time" ) var re = regexp.MustCompile(`\${(\w+)(:([a-zA-Z0-9%.]+))?}`) @@ -32,6 +33,8 @@ func FormatValue(format string, val interface{}) string { format = format[:len(format)-1] val = typed / 1e3 } + case time.Duration: + val = typed.Round(time.Second) } if format == "" {