File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ const percentBangString = "%!"
33
33
// It is invalid to include more than one %w verb or to supply it with an
34
34
// operand that does not implement the error interface. The %w verb is otherwise
35
35
// a synonym for %v.
36
+ //
37
+ // Deprecated: As of Go 1.13, use fmt.Errorf instead.
36
38
func Errorf (format string , a ... interface {}) error {
37
39
format = formatPlusW (format )
38
40
// Support a ": %[wsv]" suffix, which works well with xerrors.Formatter.
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ func (e noWrapper) FormatError(p Printer) (next error) {
35
35
36
36
// Unwrap returns the result of calling the Unwrap method on err, if err implements
37
37
// Unwrap. Otherwise, Unwrap returns nil.
38
+ //
39
+ // Deprecated: As of Go 1.13, use errors.Unwrap instead.
38
40
func Unwrap (err error ) error {
39
41
u , ok := err .(Wrapper )
40
42
if ! ok {
@@ -47,6 +49,8 @@ func Unwrap(err error) error {
47
49
//
48
50
// An error is considered to match a target if it is equal to that target or if
49
51
// it implements a method Is(error) bool such that Is(target) returns true.
52
+ //
53
+ // Deprecated: As of Go 1.13, use errors.Is instead.
50
54
func Is (err , target error ) bool {
51
55
if target == nil {
52
56
return err == target
@@ -77,6 +81,8 @@ func Is(err, target error) bool {
77
81
//
78
82
// The As method should set the target to its value and return true if err
79
83
// matches the type to which target points.
84
+ //
85
+ // Deprecated: As of Go 1.13, use errors.As instead.
80
86
func As (err error , target interface {}) bool {
81
87
if target == nil {
82
88
panic ("errors: target cannot be nil" )
You can’t perform that action at this time.
0 commit comments