blob: 2d26721d8dc4264de8e8b374d2c2b33d41176b99 [file] [log] [blame]
// Test for not using fmt.Errorf.
// Package foo ...
package foo
import (
"errors"
"fmt"
)
func f(x int) error {
if x > 10 {
return errors.New(fmt.Sprintf("something %d", x)) // MATCH /should replace.*errors\.New\(fmt\.Sprintf\(\.\.\.\)\).*fmt\.Errorf\(\.\.\.\)/
}
if x > 5 {
return errors.New(g("blah")) // ok
}
if x > 4 {
return errors.New("something else") // ok
}
return nil
}
func g(s string) string { return "prefix: " + s }