From f6962464a7960295bf58ca2f8123773a641e13c2 Mon Sep 17 00:00:00 2001
From: Benjamin Bollen <ben@erisindustries.com>
Date: Thu, 26 May 2016 15:13:13 +0200
Subject: [PATCH] improvement to style to util/fs.go

---
 util/fs.go | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/util/fs.go b/util/fs.go
index b33450b3..f8f8eb1e 100644
--- a/util/fs.go
+++ b/util/fs.go
@@ -24,14 +24,13 @@ import (
 // Ensure the directory exists or create it if needed.
 func EnsureDir(dir string, mode os.FileMode) error {
   if fileOptions, err := os.Stat(dir); os.IsNotExist(err) {
-    err := os.MkdirAll(dir, mode)
-    if err != nil {
-      return fmt.Errorf("Could not create directory %v. %v\n", dir, err)
+    if errMake := os.MkdirAll(dir, mode); errMake != nil {
+      return fmt.Errorf("Could not create directory %s. %v", dir, err)
     }
   } else if err != nil {
     return fmt.Errorf("Error asserting directory %s: %v", dir, err)
   } else if !fileOptions.IsDir() {
-    return fmt.Errorf("Path already exists as a file: %s\n", dir)
+    return fmt.Errorf("Path already exists as a file: %s", dir)
   }
   return nil
 }
-- 
GitLab