diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-07 22:09:39 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-11 21:24:15 +1000 |
commit | 77881a9c7d24bb11bc74abff35d94397fd4ccb67 (patch) | |
tree | 353a64958a3d55b82ee4326896705b61f06cca3e /pkg/utils | |
parent | c7f9d5801bd1a64c40102764b5aadae7620ad5ec (diff) |
add new integration test pattern
Diffstat (limited to 'pkg/utils')
-rw-r--r-- | pkg/utils/utils.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 3f882c2b5..2f33862e8 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -128,3 +128,10 @@ func StackTrace() string { n := runtime.Stack(buf, false) return fmt.Sprintf("%s\n", buf[:n]) } + +// returns the path of the file that calls the function. +// 'skip' is the number of stack frames to skip. +func FilePath(skip int) string { + _, path, _, _ := runtime.Caller(skip) + return path +} |