gitlab.com/evatix-go/core@v1.3.55/codestack/Dir.go (about) 1 package codestack 2 3 import ( 4 "path/filepath" 5 "runtime" 6 7 "gitlab.com/evatix-go/core/constants" 8 ) 9 10 func Dir(skipStack int) string { 11 _, filePath, _, isOkay := runtime.Caller(skipStack + defaultInternalSkip) 12 13 if isOkay { 14 return filepath.Dir(filePath) 15 } 16 17 return constants.EmptyString 18 }