Prefer fmt.Errorf(s) to errors.New(fmt.Sprintf(s))

This commit is contained in:
Rob Mulholand
2019-10-31 13:33:39 -05:00
parent eb2f3c2209
commit 0ded7bcd62
5 changed files with 12 additions and 16 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
package postgres
import (
"errors"
"fmt"
)
@@ -34,5 +33,5 @@ func ErrUnableToSetNode(setErr error) error {
}
func formatError(msg, err string) error {
return errors.New(fmt.Sprintf("%s: %s", msg, err))
return fmt.Errorf("%s: %s", msg, err)
}