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.
CallerInfo()
1 parent 2b00d33 commit 0ab3ce1Copy full SHA for 0ab3ce1
assert/assertions.go
@@ -8,7 +8,6 @@ import (
8
"fmt"
9
"math"
10
"os"
11
- "path/filepath"
12
"reflect"
13
"regexp"
14
"runtime"
@@ -141,12 +140,11 @@ func CallerInfo() []string {
141
140
}
142
143
parts := strings.Split(file, "/")
144
- file = parts[len(parts)-1]
145
if len(parts) > 1 {
+ filename := parts[len(parts)-1]
146
dir := parts[len(parts)-2]
147
- if (dir != "assert" && dir != "mock" && dir != "require") || file == "mock_test.go" {
148
- path, _ := filepath.Abs(file)
149
- callers = append(callers, fmt.Sprintf("%s:%d", path, line))
+ if (dir != "assert" && dir != "mock" && dir != "require") || filename == "mock_test.go" {
+ callers = append(callers, fmt.Sprintf("%s:%d", file, line))
150
151
152
0 commit comments