This repository was archived by the owner on Dec 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed
Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 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 stacktracer interface {
62+ // type stackTracer interface {
6363// StackTrace() errors.StackTrace
6464// }
6565//
6666// Where errors.StackTrace is defined as
6767//
6868// type StackTrace []Frame
6969//
70- // The Frame type represents a call site in the stacktrace . Frame supports
70+ // The Frame type represents a call site in the stack trace . Frame supports
7171// the fmt.Formatter interface that can be used for printing information about
72- // the stacktrace of this error. For example:
72+ // the stack trace of this error. For example:
7373//
74- // if err, ok := err.(stacktracer ); ok {
74+ // if err, ok := err.(stackTracer ); ok {
7575// for _, f := range err.StackTrace() {
7676// fmt.Printf("%+s:%d", f)
7777// }
Original file line number Diff line number Diff line change @@ -119,14 +119,14 @@ func ExampleErrorf_extended() {
119119 // /home/dfc/go/src/runtime/asm_amd64.s:2059
120120}
121121
122- func Example_stacktrace () {
123- type stacktracer interface {
122+ func Example_stackTrace () {
123+ type stackTracer interface {
124124 StackTrace () errors.StackTrace
125125 }
126126
127- err , ok := errors .Cause (fn ()).(stacktracer )
127+ err , ok := errors .Cause (fn ()).(stackTracer )
128128 if ! ok {
129- panic ("oops, err does not implement stacktracer " )
129+ panic ("oops, err does not implement stackTracer " )
130130 }
131131
132132 st := err .StackTrace ()
@@ -135,7 +135,7 @@ func Example_stacktrace() {
135135 // Example output:
136136 // github.com/pkg/errors_test.fn
137137 // /home/dfc/src/github.com/pkg/errors/example_test.go:47
138- // github.com/pkg/errors_test.Example_stacktrace
138+ // github.com/pkg/errors_test.Example_stackTrace
139139 // /home/dfc/src/github.com/pkg/errors/example_test.go:127
140140}
141141
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ func TestStackTrace(t *testing.T) {
222222 }
223223}
224224
225- func stacktrace () StackTrace {
225+ func stackTrace () StackTrace {
226226 const depth = 8
227227 var pcs [depth ]uintptr
228228 n := runtime .Callers (1 , pcs [:])
@@ -268,23 +268,23 @@ func TestStackTraceFormat(t *testing.T) {
268268 "%#v" ,
269269 `\[\]errors.Frame{}` ,
270270 }, {
271- stacktrace ()[:2 ],
271+ stackTrace ()[:2 ],
272272 "%s" ,
273273 `\[stack_test.go stack_test.go\]` ,
274274 }, {
275- stacktrace ()[:2 ],
275+ stackTrace ()[:2 ],
276276 "%v" ,
277277 `\[stack_test.go:228 stack_test.go:275\]` ,
278278 }, {
279- stacktrace ()[:2 ],
279+ stackTrace ()[:2 ],
280280 "%+v" ,
281281 "\n " +
282- "github.com/pkg/errors.stacktrace \n " +
282+ "github.com/pkg/errors.stackTrace \n " +
283283 "\t .+/github.com/pkg/errors/stack_test.go:228\n " +
284284 "github.com/pkg/errors.TestStackTraceFormat\n " +
285285 "\t .+/github.com/pkg/errors/stack_test.go:279" ,
286286 }, {
287- stacktrace ()[:2 ],
287+ stackTrace ()[:2 ],
288288 "%#v" ,
289289 `\[\]errors.Frame{stack_test.go:228, stack_test.go:287}` ,
290290 }}
You can’t perform that action at this time.
0 commit comments