From a65355658a09e7f735e4bd5730df44a6b3b6d4de Mon Sep 17 00:00:00 2001 From: Matthias Diester Date: Sun, 15 Oct 2023 20:22:16 +0200 Subject: [PATCH] Mark `Error` and `Errorf` as deprecated With `fmt.Errorf`, there is no good reason for this function anymore. --- error.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/error.go b/error.go index c253dc6..8c14639 100644 --- a/error.go +++ b/error.go @@ -82,6 +82,8 @@ func (e *wrappedErrors) Errors() []error { } // Error creates an error with additional context +// +// Deprecated: Use fmt.Errorf() instead using the `%w` format specifier. func Error(err error, context string) error { switch { case err == nil: @@ -93,6 +95,8 @@ func Error(err error, context string) error { } // Errorf creates an error with additional formatted context +// +// Deprecated: Use fmt.Errorf() instead using the `%w` format specifier. func Errorf(err error, format string, a ...interface{}) error { return Error(err, fmt.Sprintf(format, a...)) }