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

Unified Diff: mojo/public/tools/bindings/generators/mojom_go_generator.py

Issue 1945103002: Go bindings: Don't import 'fmt' unless it is needed. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « mojo/go/tests/test_enums.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/mojom_go_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_go_generator.py b/mojo/public/tools/bindings/generators/mojom_go_generator.py
index 385989d0cc48c308fdc73f9d7c678720227922ef..88d83ac303fd8c66d5bc80fc74d4cfb48ea1e482 100644
--- a/mojo/public/tools/bindings/generators/mojom_go_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_go_generator.py
@@ -370,7 +370,7 @@ class Generator(generator.Generator):
all_structs.append(self._GetResponseStructFromMethod(method))
if (len(all_structs) > 0 or len(self.module.interfaces) > 0
- or len(self.module.unions) > 0 or len(self.module.enums) > 0):
+ or len(self.module.unions) > 0):
imports['fmt'] = 'fmt'
imports['mojo/public/go/bindings'] = 'bindings'
if len(self.module.interfaces) > 0:
@@ -403,7 +403,9 @@ class Generator(generator.Generator):
imports['bytes'] = 'bytes'
imports['compress/gzip'] = 'gzip'
imports['encoding/base64'] = 'base64'
+ imports['fmt'] = 'fmt'
imports['io/ioutil'] = 'ioutil'
+ imports['mojo/public/go/bindings'] = 'bindings'
if GetPackageName(self.module) != _mojom_types_pkg_short:
if defInterface:
« no previous file with comments | « mojo/go/tests/test_enums.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698