diff --git a/perfdata/type.go b/perfdata/type.go index 4814208..dc9202e 100644 --- a/perfdata/type.go +++ b/perfdata/type.go @@ -43,8 +43,6 @@ func formatNumeric(value interface{}) (string, error) { return check.FormatFloat(float64(v)), nil case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: return fmt.Sprintf("%d", v), nil - case fmt.Stringer, string: - return fmt.Sprint(v), nil default: panic(fmt.Sprintf("unsupported type for perfdata: %T", value)) } diff --git a/perfdata/type_test.go b/perfdata/type_test.go index 6168df3..5eff5e3 100644 --- a/perfdata/type_test.go +++ b/perfdata/type_test.go @@ -123,14 +123,11 @@ func TestFormatNumeric(t *testing.T) { }, { Result: "1234.567", - InputValue: 1234.567, + InputValue: float64(1234.567), }, { - Result: "1234.567", - InputValue: float32(1234.567), - }, - {Result: "1234.567", - InputValue: "1234.567", + Result: "3456.789", + InputValue: float32(3456.789), }, { Result: "1234567890.988",