From e42e2ac5e672ce193e3e69c4a33ad37d8f739ee0 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sat, 7 Sep 2024 10:27:42 -0700 Subject: [PATCH] chore!: remove deprecated Error.String method Signed-off-by: James Hillyerd --- error.go | 5 ----- error_test.go | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/error.go b/error.go index de8e6aa..0f16ae6 100644 --- a/error.go +++ b/error.go @@ -43,11 +43,6 @@ func (e *Error) Error() string { return fmt.Sprintf("[%s] %s: %s", sev, e.Name, e.Detail) } -// String formats the enmime.Error as a string. DEPRECATED; use Error() instead. -func (e *Error) String() string { - return e.Error() -} - // addError builds a severe Error and appends to the Part error slice. func (p *Part) addError(name string, detail string) { p.addProblem(&Error{name, detail, true}) diff --git a/error_test.go b/error_test.go index 3a303ff..e04b991 100644 --- a/error_test.go +++ b/error_test.go @@ -27,9 +27,8 @@ func TestErrorStringConversion(t *testing.T) { Severe: true, } - // Using deprecated String() method here for test coverage want = "[E] ErrorName: Error Details" - got = e.String() + got = e.Error() if got != want { t.Error("got:", got, "want:", want) }