summaryrefslogtreecommitdiffstats
path: root/pkg/utils
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-08-07 22:09:39 +1000
committerJesse Duffield <jessedduffield@gmail.com>2022-08-11 21:24:15 +1000
commit77881a9c7d24bb11bc74abff35d94397fd4ccb67 (patch)
tree353a64958a3d55b82ee4326896705b61f06cca3e /pkg/utils
parentc7f9d5801bd1a64c40102764b5aadae7620ad5ec (diff)
add new integration test pattern
Diffstat (limited to 'pkg/utils')
-rw-r--r--pkg/utils/utils.go7
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
+}