@@ -11,22 +11,6 @@ import (
1111// Frame represents a program counter inside a stack frame.
1212type Frame runtime.Frame
1313
14- // file returns the full path to the file that contains the
15- // function for this Frame's pc.
16- func (f Frame ) file () string {
17- file := runtime .Frame (f ).File
18- if file == "" {
19- return "unknown"
20- }
21- return file
22- }
23-
24- // line returns the line number of source code of the
25- // function for this Frame's pc.
26- func (f Frame ) line () int {
27- return runtime .Frame (f ).Line
28- }
29-
3014// Format formats the frame according to the fmt.Formatter interface.
3115//
3216// %s source file
@@ -52,10 +36,14 @@ func (f Frame) Format(s fmt.State, verb rune) {
5236 fmt .Fprintf (s , "%s\n \t %s" , fn .Name (), file )
5337 }
5438 default :
55- io .WriteString (s , path .Base (f .file ()))
39+ file := runtime .Frame (f ).File
40+ if file == "" {
41+ file = "unknown"
42+ }
43+ io .WriteString (s , path .Base (file ))
5644 }
5745 case 'd' :
58- fmt .Fprintf (s , "%d" , f . line () )
46+ fmt .Fprintf (s , "%d" , runtime . Frame ( f ). Line )
5947 case 'n' :
6048 name := runtime .Frame (f ).Function
6149 io .WriteString (s , funcname (name ))
0 commit comments