From 494e70f7620561491c2ca11e185bbef4b70060da Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Thu, 16 Jun 2016 17:40:57 +1000 Subject: [PATCH] Rename StackTrace interface to stacktracer in docs and examples (#56) --- errors.go | 4 ++-- example_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/errors.go b/errors.go index 65bf7a0..ab18602 100644 --- a/errors.go +++ b/errors.go @@ -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 // } // @@ -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) // } diff --git a/example_test.go b/example_test.go index f1df234..cc62bf4 100644 --- a/example_test.go +++ b/example_test.go @@ -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()