Unwrap in Walk for compat with go1.13 errors
diff --git a/errwrap.go b/errwrap.go
index 325f278..44e368e 100644
--- a/errwrap.go
+++ b/errwrap.go
@@ -44,6 +44,8 @@
 //
 // format is the format of the error message. The string '{{err}}' will
 // be replaced with the original error message.
+//
+// Deprecated: Use fmt.Errorf()
 func Wrapf(format string, err error) error {
 	outerMsg := "<nil>"
 	if err != nil {
@@ -148,6 +150,9 @@
 		for _, err := range e.WrappedErrors() {
 			Walk(err, cb)
 		}
+	case interface{ Unwrap() error }:
+		cb(err)
+		Walk(e.Unwrap(), cb)
 	default:
 		cb(err)
 	}
@@ -170,4 +175,4 @@
 
 func (w *wrappedError) Unwrap() error {
 	return w.Inner
-}
\ No newline at end of file
+}
diff --git a/errwrap_test.go b/errwrap_test.go
index 60d37d3..8c16a56 100644
--- a/errwrap_test.go
+++ b/errwrap_test.go
@@ -42,6 +42,16 @@
 			"foo",
 			1,
 		},
+		{
+			fmt.Errorf("foo: %w", fmt.Errorf("bar")),
+			"foo: bar",
+			1,
+		},
+		{
+			fmt.Errorf("foo: %w", fmt.Errorf("bar")),
+			"bar",
+			1,
+		},
 	}
 
 	for i, tc := range cases {
@@ -84,6 +94,11 @@
 			Wrapf("", nil),
 			0,
 		},
+		{
+			fmt.Errorf("one: %w", fmt.Errorf("two: %w", fmt.Errorf("three"))),
+			fmt.Errorf("%w", errors.New("")),
+			2,
+		},
 	}
 
 	for i, tc := range cases {
@@ -101,4 +116,4 @@
 	if actual != inner {
 		t.Fatal("wrappedError did not unwrap to inner")
 	}
-}
\ No newline at end of file
+}