blob: 768fb8ce60f9bd65f6439edb3889652e58f4cc04 [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
}