Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions perfdata/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
9 changes: 3 additions & 6 deletions perfdata/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down