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

Commit 494e70f

Browse files
authored
Rename StackTrace interface to stacktracer in docs and examples (#56)
1 parent 01fa410 commit 494e70f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are
6060
// invoked. This information can be retrieved with the following interface.
6161
//
62-
// type StackTrace interface {
62+
// type stacktracer interface {
6363
// StackTrace() errors.StackTrace
6464
// }
6565
//
@@ -71,7 +71,7 @@
7171
// the fmt.Formatter interface that can be used for printing information about
7272
// the stacktrace of this error. For example:
7373
//
74-
// if err, ok := err.(StackTrace); ok {
74+
// if err, ok := err.(stacktracer); ok {
7575
// for _, f := range err.StackTrace() {
7676
// fmt.Printf("%+s:%d", f)
7777
// }

example_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ func ExampleErrorf_extended() {
120120
}
121121

122122
func Example_stacktrace() {
123-
type StackTrace interface {
123+
type stacktracer interface {
124124
StackTrace() errors.StackTrace
125125
}
126126

127-
err, ok := errors.Cause(fn()).(StackTrace)
127+
err, ok := errors.Cause(fn()).(stacktracer)
128128
if !ok {
129-
panic("oops, err does not implement StackTrace")
129+
panic("oops, err does not implement stacktracer")
130130
}
131131

132132
st := err.StackTrace()

0 commit comments

Comments
 (0)