File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ type withStack struct {
186186}
187187
188188func (w * withStack ) Cause () error { return w .error }
189+ func (w * withStack ) Unwrap () error { return w .error }
189190
190191func (w * withStack ) Format (s fmt.State , verb rune ) {
191192 switch verb {
@@ -298,6 +299,8 @@ type withMessage struct {
298299
299300func (w * withMessage ) Error () string { return w .msg + ": " + w .cause .Error () }
300301func (w * withMessage ) Cause () error { return w .cause }
302+ func (w * withMessage ) Unwrap () error { return w .cause }
303+
301304
302305func (w * withMessage ) Format (s fmt.State , verb rune ) {
303306 switch verb {
@@ -331,7 +334,7 @@ func Cause(err error) error {
331334
332335 for err != nil {
333336 var c causer
334- if ! errors . As (err , & c ) {
337+ if ! As (err , & c ) {
335338 break
336339 }
337340 err = c .Cause ()
Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ type withStack struct {
187187}
188188
189189func (w * withStack ) Cause () error { return w .error }
190+ func (w * withStack ) Unwrap () error { return w .error }
190191
191192func (w * withStack ) Format (s fmt.State , verb rune ) {
192193 switch verb {
@@ -291,6 +292,7 @@ type withMessage struct {
291292
292293func (w * withMessage ) Error () string { return w .msg + ": " + w .cause .Error () }
293294func (w * withMessage ) Cause () error { return w .cause }
295+ func (w * withMessage ) Unwrap () error { return w .cause }
294296
295297func (w * withMessage ) Format (s fmt.State , verb rune ) {
296298 switch verb {
You can’t perform that action at this time.
0 commit comments