Merge pull request #215 from dnephin/mkdir-in-update

golden: only create dir if update flag is set
diff --git a/golden/golden.go b/golden/golden.go
index 54102dd..6026b44 100644
--- a/golden/golden.go
+++ b/golden/golden.go
@@ -175,13 +175,13 @@
 }
 
 func update(filename string, actual []byte) error {
+	if !*flagUpdate {
+		return nil
+	}
 	if dir := filepath.Dir(filename); dir != "." {
 		if err := os.MkdirAll(dir, 0755); err != nil {
 			return err
 		}
 	}
-	if *flagUpdate {
-		return ioutil.WriteFile(Path(filename), actual, 0644)
-	}
-	return nil
+	return ioutil.WriteFile(Path(filename), actual, 0644)
 }