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

This commit is contained in:
Rob Mulholand committed 2019-10-31 13:33:39 -05:00
1 parent eb2f3c2209
commit 0ded7bcd62
5 files changed
+12 -16

No files matched your search

+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)
}