From 4b6741ca3bac84fd40fabde2e34e321081e4cdbf Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Thu, 3 Dec 2015 23:44:24 -0800 Subject: [PATCH] EnsureDir() takes file mode --- os.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os.go b/os.go index 170c6f82a..43fed1349 100644 --- a/os.go +++ b/os.go @@ -36,9 +36,9 @@ func Exit(s string) { os.Exit(1) } -func EnsureDir(dir string) error { +func EnsureDir(dir string, mode os.FileMode) error { if _, err := os.Stat(dir); os.IsNotExist(err) { - err := os.MkdirAll(dir, 0700) + err := os.MkdirAll(dir, mode) if err != nil { return fmt.Errorf("Could not create directory %v. %v", dir, err) }