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

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

Issue 2233963003: Add support for constants in the new go generator. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge branch 'master' of github.com:domokit/mojo into const Created 4 years, 4 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 fdb237eb498b0b104e360030aa6499a5c4174812..f5e3f02a1461dc03f6c22de9eab7f2c0ee8dfe6f 100644
--- a/mojom/generators/go/templates/templates.go
+++ b/mojom/generators/go/templates/templates.go
@@ -92,5 +92,9 @@ import (
{{- range $interface := $fileTmpl.Interfaces}}
{{ template "Interface" $interface }}
{{- end}}
+
+{{- range $constant := $fileTmpl.Constants}}
+const {{$constant.Name}} {{$constant.Type}} = {{$constant.Value}}
+{{end}}
{{- end -}}
`

Powered by Google App Engine
This is Rietveld 408576698