summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--golib/filepath.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/golib/filepath.go b/golib/filepath.go
index 90424d7..9897163 100644
--- a/golib/filepath.go
+++ b/golib/filepath.go
@@ -23,6 +23,18 @@ func Exists(path string) bool {
return true
}
+// IsDir returns true when the given path is a directory
+func IsDir(path string) bool {
+ fi, err := os.Stat(path)
+ if err != nil {
+ dd
+ fmt.Printf("SEB %v", path)
+ return false
+ }
+
+ return fi.Mode().IsDir()
+}
+
// ResolveEnvVar Resolved environment variable regarding the syntax ${MYVAR}
// or $MYVAR following by a slash or a backslash
func ResolveEnvVar(s string) (string, error) {