DescriptionGo bindings: Don't import 'fmt' unless it is needed.
In https://codereview.chromium.org/1943643002/ I introduced a bug in mojom_go_generator.py
regarding when to import the 'fmt' package (and also the mojo/public/go/bindings package)
into the generated Go code. I knew there was an additional case where it
needed to be added but I thought it was the case where a .mojom file had
only enums and nothing else. But it turns out it was the case where
that was true and we are generating runtime type info because the flag
generate_type_info=true. It turns out just checking for this latter condition
is sufficient.
The reason I hadn't caught this was that we didn't have a test where runtime
type info was not being generated. I have now added one.
R=azani@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/6a329476c90cc8ea18d52251555783e11a0915fe
Patch Set 1 #
Messages
Total messages: 10 (7 generated)
|