From dc90524a779b43e71efdcb091a292767557802ab Mon Sep 17 00:00:00 2001 From: Charles Korn Date: Tue, 23 Jul 2024 12:07:07 +1000 Subject: [PATCH] Address PR feedback --- spanlogger/spanlogger_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spanlogger/spanlogger_test.go b/spanlogger/spanlogger_test.go index 641c583b6..70ab9ec36 100644 --- a/spanlogger/spanlogger_test.go +++ b/spanlogger/spanlogger_test.go @@ -5,6 +5,7 @@ import ( "context" "fmt" "io" + "path/filepath" "runtime" "strings" "testing" @@ -296,7 +297,7 @@ func TestSpanLogger_CallerInfo(t *testing.T) { } func toCallerInfo(path string, lineNumber int) string { - fileName := path[strings.LastIndex(path, "/")+1:] + fileName := filepath.Base(path) return fmt.Sprintf("%s:%v", fileName, lineNumber) }