Skip to content

Commit

Permalink
Rename StackTrace interface to stacktracer in docs and examples (pkg#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
davecheney authored Jun 16, 2016
1 parent 01fa410 commit 494e70f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are
// invoked. This information can be retrieved with the following interface.
//
// type StackTrace interface {
// type stacktracer interface {
// StackTrace() errors.StackTrace
// }
//
Expand All @@ -71,7 +71,7 @@
// the fmt.Formatter interface that can be used for printing information about
// the stacktrace of this error. For example:
//
// if err, ok := err.(StackTrace); ok {
// if err, ok := err.(stacktracer); ok {
// for _, f := range err.StackTrace() {
// fmt.Printf("%+s:%d", f)
// }
Expand Down
6 changes: 3 additions & 3 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ func ExampleErrorf_extended() {
}

func Example_stacktrace() {
type StackTrace interface {
type stacktracer interface {
StackTrace() errors.StackTrace
}

err, ok := errors.Cause(fn()).(StackTrace)
err, ok := errors.Cause(fn()).(stacktracer)
if !ok {
panic("oops, err does not implement StackTrace")
panic("oops, err does not implement stacktracer")
}

st := err.StackTrace()
Expand Down

0 comments on commit 494e70f

Please sign in to comment.