diff --git a/errors.go b/errors.go index 18a9e68d..1220ebc1 100644 --- a/errors.go +++ b/errors.go @@ -1,11 +1,14 @@ // Package errors implements functions to manipulate errors. package errors -import "fmt" +import ( + "errors" + "fmt" +) // New returns an error that formats as the given text. func New(text string) error { - return Errorf(text) + return errors.New(text) } // Errorf returns a formatted error. diff --git a/errors_test.go b/errors_test.go index 7c094c49..1c169beb 100644 --- a/errors_test.go +++ b/errors_test.go @@ -1,6 +1,7 @@ package errors import ( + "errors" "fmt" "io" "reflect" @@ -24,6 +25,7 @@ func TestNewError(t *testing.T) { {"", fmt.Errorf("")}, {"foo", fmt.Errorf("foo")}, {"foo", New("foo")}, + {"foo %s", errors.New("foo %s")}, } for _, tt := range tests {