Index: mojom/generators/go/templates/templates.go |
diff --git a/mojom/generators/go/templates/templates.go b/mojom/generators/go/templates/templates.go |
index 4d6a945331c77ffad8aa60844c7fcb401f98e089..4eba4ea163b5214e7964d1047d44248761fa57e4 100644 |
--- a/mojom/generators/go/templates/templates.go |
+++ b/mojom/generators/go/templates/templates.go |
@@ -6,6 +6,7 @@ package templates |
import ( |
"bytes" |
+ "io/ioutil" |
"text/template" |
"mojom/generators/go/gofmt" |
@@ -23,9 +24,11 @@ func ExecuteTemplates(tmplFile *translator.TmplFile) string { |
panic(err) |
} |
- src, err := gofmt.FormatGoFile(buffer.String()) |
+ unformatted := buffer.String() |
+ src, err := gofmt.FormatGoFile(unformatted) |
if err != nil { |
+ ioutil.WriteFile("/tmp/unformatted.go", buffer.Bytes(), 0666) |
panic(err) |
} |
return src |