We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a056f81 commit 013a60cCopy full SHA for 013a60c
internal/stack/record.go
@@ -2,6 +2,7 @@ package stack
2
3
import (
4
"fmt"
5
+ "path"
6
"runtime"
7
"strings"
8
@@ -108,11 +109,7 @@ func (c call) Record(opts ...recordOption) string {
108
109
110
func extractName(function uintptr, file string) (name, fileName string) {
111
name = runtime.FuncForPC(function).Name()
- if i := strings.LastIndex(file, "/"); i > -1 {
112
- fileName = file[i+1:]
113
- } else {
114
- fileName = file
115
- }
+ _, fileName = path.Split(file)
116
name = strings.ReplaceAll(name, "[...]", "")
117
118
return name, fileName
0 commit comments