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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package templates 5 package templates
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "io/ioutil" 9 "io/ioutil"
10 "text/template" 10 "text/template"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 {{ template "Union" $union }} 85 {{ template "Union" $union }}
86 {{- end}} 86 {{- end}}
87 87
88 {{- range $enum := $fileTmpl.Enums}} 88 {{- range $enum := $fileTmpl.Enums}}
89 {{ template "EnumDecl" $enum }} 89 {{ template "EnumDecl" $enum }}
90 {{- end}} 90 {{- end}}
91 91
92 {{- range $interface := $fileTmpl.Interfaces}} 92 {{- range $interface := $fileTmpl.Interfaces}}
93 {{ template "Interface" $interface }} 93 {{ template "Interface" $interface }}
94 {{- end}} 94 {{- end}}
95
96 {{- range $constant := $fileTmpl.Constants}}
97 const {{$constant.Name}} {{$constant.Type}} = {{$constant.Value}}
98 {{end}}
95 {{- end -}} 99 {{- end -}}
96 ` 100 `
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698