File tree 2 files changed +3
-6
lines changed
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ func NewFrame(f runtime.Frame) Frame {
159
159
var module string
160
160
161
161
if filename != "" {
162
- filename = extractFilename (filename )
162
+ filename = filepath . Base (filename )
163
163
} else {
164
164
filename = unknown
165
165
}
@@ -226,11 +226,6 @@ func filterFrames(frames []Frame) []Frame {
226
226
return filteredFrames
227
227
}
228
228
229
- func extractFilename (path string ) string {
230
- _ , file := filepath .Split (path )
231
- return file
232
- }
233
-
234
229
func isInAppFrame (frame Frame ) bool {
235
230
if strings .HasPrefix (frame .AbsPath , build .Default .GOROOT ) ||
236
231
strings .Contains (frame .Module , "vendor" ) ||
Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ func TestNewStacktrace(t *testing.T) {
31
31
32
32
assertEqual (t , len (stacktrace .Frames ), 2 )
33
33
assertEqual (t , stacktrace .Frames [0 ].Function , "TestNewStacktrace" )
34
+ assertEqual (t , stacktrace .Frames [0 ].Filename , "stacktrace_test.go" )
34
35
assertEqual (t , stacktrace .Frames [1 ].Function , "Trace" )
36
+ assertEqual (t , stacktrace .Frames [1 ].Filename , "errors_test.go" )
35
37
}
36
38
37
39
func BenchmarkNewStacktrace (b * testing.B ) {
You can’t perform that action at this time.
0 commit comments