Files
kubescape/internal/testutils/dir.go
Matthias Bertschy 6042818a71 use go 1.24
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-06-24 16:31:45 +02:00

16 lines
296 B
Go

package testutils
import (
"path/filepath"
"runtime"
)
// CurrentDir returns the directory of the file where this function is defined.
func CurrentDir() string {
_, filename, _, ok := runtime.Caller(1)
if !ok {
panic("failed to get current file info")
}
return filepath.Dir(filename)
}