mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-14 09:59:54 +00:00
16 lines
296 B
Go
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)
|
|
}
|