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

Issue 1945103002: Go bindings: Don't import 'fmt' unless it is needed. (Closed)

Created:
4 years, 7 months ago by rudominer
Modified:
4 years, 7 months ago
Reviewers:
vardhan, azani
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, yzshen+mojopublicwatch_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Go 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -3 lines) Patch
M mojo/go/BUILD.gn View 3 chunks +12 lines, -0 lines 0 comments Download
M mojo/go/tests/enums_test.go View 3 chunks +22 lines, -0 lines 0 comments Download
A + mojo/go/tests/test_enums.mojom View 1 chunk +1 line, -2 lines 0 comments Download
M mojo/public/tools/bindings/generators/mojom_go_generator.py View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 10 (7 generated)
rudominer
Hi Alex and Vardhan, ptal. The problem I'm fixing was mentioned here: https://github.com/domokit/mojo/commit/2f2d1bece6eb2dae607edadbc7355cec65e892fb#commitcomment-17345659
4 years, 7 months ago (2016-05-04 01:32:04 UTC) #7
azani
lgtm
4 years, 7 months ago (2016-05-04 01:39:49 UTC) #8
rudominer
4 years, 7 months ago (2016-05-04 01:42:45 UTC) #10
Message was sent while issue was closed.
Committed patchset #1 (id:40001) manually as
6a329476c90cc8ea18d52251555783e11a0915fe (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698