Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit d4b5735

Browse files
committed
update README, reduce duplication with godoc
1 parent 7f46da0 commit d4b5735

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,6 @@ if err != nil {
1919
return errors.Wrap(err, "read failed")
2020
}
2121
```
22-
## Retrieving the stack trace of an error or wrapper
23-
24-
`New`, `Errorf`, `Wrap`, and `Wrapf` record a stack trace at the point they are invoked.
25-
This information can be retrieved with the following interface.
26-
```go
27-
type Stacktrace interface {
28-
Stacktrace() []Frame
29-
}
30-
```
31-
The `Frame` type represents a call site in the stacktrace.
32-
`Frame` supports the `fmt.Formatter` interface that can be used for printing information about the stacktrace of this error. For example
33-
```go
34-
if err, ok := err.(Stacktrace); ok {
35-
for _, f := range err.Stacktrace() {
36-
fmt.Printf("%+s:%d", f)
37-
}
38-
}
39-
```
40-
See [the documentation for `Frame.Format`](https://godoc.org/github.com/pkg/errors#Frame_Format) for more details.
41-
4222
## Retrieving the cause of an error
4323

4424
Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`.
@@ -57,7 +37,7 @@ default:
5737
}
5838
```
5939

60-
Would you like to know more? Read the [blog post](http://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully).
40+
[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors).
6141

6242
## Contributing
6343

0 commit comments

Comments
 (0)