Chromium Code Reviews| Index: mojo/public/tools/bindings/generators/go_templates/struct.tmpl |
| diff --git a/mojo/public/tools/bindings/generators/go_templates/struct.tmpl b/mojo/public/tools/bindings/generators/go_templates/struct.tmpl |
| index 444ffdb26e4cb0eb0b24f02fa4f93e0beb5cf418..1b7fbb0510f675c39979471fe985583735785a61 100644 |
| --- a/mojo/public/tools/bindings/generators/go_templates/struct.tmpl |
| +++ b/mojo/public/tools/bindings/generators/go_templates/struct.tmpl |
| @@ -3,8 +3,10 @@ |
| // found in the LICENSE file. |
| {% import "encoding_macros.tmpl" as encoding_macros %} |
| +{% import "mojom_type_macros.tmpl" as mojom_type_macros %} |
| +{% import "mojom_util_macros.tmpl" as util %} |
| -{% macro define(struct, exported=True) %} |
| +{% macro define(struct, typepkg, package, exported=True) %} |
| type {{struct|name(exported)}} struct { |
| {% for field in struct.fields %} |
| {{field|name(exported)}} {{field.kind|go_type}} |
| @@ -63,4 +65,7 @@ func (s *{{struct|name(exported)}}) Decode(decoder *bindings.Decoder) error { |
| return nil |
| } |
| +var {{util.structName(struct, typepkg, package)}} = {{ |
|
mattr
2015/09/17 00:37:35
What if instead of declaring global exported varia
alexfandrianto
2015/10/09 17:43:55
I need some level of globalness and will only expo
|
| + mojom_type_macros.writeMojomType(typepkg, struct, package, exported) }} |
| + |
| {% endmacro %} |