1
0
mirror of https://github.com/divan/expvarmon.git synced 2025-05-01 13:48:50 +08:00

Add float64 for time.Duration fields

This commit is contained in:
Ivan Daniluk 2016-11-06 17:18:43 +01:00
parent 8db43807c3
commit 5514921bcd

3
var.go
View File

@ -89,6 +89,9 @@ func Format(v VarValue, kind VarKind) string {
}
return fmt.Sprintf("%s", byten.Size(v.(int64)))
case KindDuration:
if _, ok := v.(float64); ok {
return fmt.Sprintf("%s", roundDuration(time.Duration(v.(float64))))
}
if _, ok := v.(int64); !ok {
break
}