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 +4
-8
lines changed
Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 8282//
8383// if err, ok := err.(stackTracer); ok {
8484// for _, f := range err.StackTrace() {
85- // fmt.Printf("%+s:%d" , f)
85+ // fmt.Printf("%+s:%d\n", f , f)
8686// }
8787// }
8888//
Original file line number Diff line number Diff line change @@ -11,10 +11,6 @@ import (
1111// Frame represents a program counter inside a stack frame.
1212type Frame runtime.Frame
1313
14- // pc returns the program counter for this frame;
15- // multiple frames may have the same PC value.
16- func (f Frame ) pc () uintptr { return runtime .Frame (f ).PC }
17-
1814// file returns the full path to the file that contains the
1915// function for this Frame's pc.
2016func (f Frame ) file () string {
@@ -61,7 +57,7 @@ func (f Frame) Format(s fmt.State, verb rune) {
6157 case 'd' :
6258 fmt .Fprintf (s , "%d" , f .line ())
6359 case 'n' :
64- name := runtime .FuncForPC ( f . pc ()). Name ()
60+ name := runtime .Frame ( f ). Function
6561 io .WriteString (s , funcname (name ))
6662 case 'v' :
6763 f .Format (s , 's' )
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ var initpc = caller()
1010
1111type X struct {}
1212
13- //go:noinline
13+ // val returns a Frame pointing to itself.
1414func (x X ) val () Frame {
1515 return caller ()
1616}
1717
18- //go:noinline
18+ // ptr returns a Frame pointing to itself.
1919func (x * X ) ptr () Frame {
2020 return caller ()
2121}
You can’t perform that action at this time.
0 commit comments