fixed error string grammar

This commit is contained in:
John O'Keefe 2024-02-03 11:11:54 -05:00
parent 5cbc048b51
commit 56fa94fce7

View File

@ -5,10 +5,10 @@ import "fmt"
func paintNeeded(width float64, height float64) (paintNeededCalculated float64, anError error) {
area := width * height
if width < 0.0 {
return 0, fmt.Errorf("a width of %0.2f is invalid.", width)
return 0, fmt.Errorf("a width of %0.2f is invalid", width)
}
if height < 0.0 {
return 0, fmt.Errorf("a height of %0.2f is invalid.", height)
return 0, fmt.Errorf("a height of %0.2f is invalid", height)
}
return area / 10.0, nil
}