Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Unified Diff: mojom/generators/go/templates/templates.go

Issue 2082173002: New go generator shakedown. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698