fix error in Stacktrace example
diff --git a/README.md b/README.md
index b2f741a..a3d517e 100644
--- a/README.md
+++ b/README.md
@@ -30,9 +30,11 @@
```
The `Frame` type represents a call site in the stacktrace.
`Frame` supports the `fmt.Formatter` interface that can be used for printing information about the stacktrace of this error. For example
-```
+```go
if err, ok := err.(Stacktrace); ok {
- fmt.Printf("%+s:%d", err.Stacktrace())
+ for _, f := range err.Stacktrace() {
+ fmt.Printf("%+s:%d", f)
+ }
}
```
See [the documentation for `Frame.Format`](https://godoc.org/github.com/pkg/errors#Frame_Format) for more details.