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

Unified Diff: mojom/generators/go/translator/translator.go

Issue 2077113002: Handle interfaces with a ServiceName in the go bindings generator. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix names issue. Created 4 years, 6 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 | « mojom/generators/go/translator/names.go ('k') | mojom/generators/go/translator/types.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/generators/go/translator/translator.go
diff --git a/mojom/generators/go/translator/translator.go b/mojom/generators/go/translator/translator.go
index f71708d9180efd26c960f06b4498a34a2f8e906a..96ad8b0ea2068d0e44a42fa7506275710eb2bdd7 100644
--- a/mojom/generators/go/translator/translator.go
+++ b/mojom/generators/go/translator/translator.go
@@ -57,6 +57,11 @@ func (t *translator) TranslateMojomFile(fileName string) (tmplFile *TmplFile) {
tmplFile.Enums[i+topLevelEnumsNum] = t.translateMojomEnum(typeKey)
}
+ tmplFile.Interfaces = make([]*InterfaceTemplate, len(*file.DeclaredMojomObjects.Interfaces))
+ for i, typeKey := range *file.DeclaredMojomObjects.Interfaces {
+ tmplFile.Interfaces[i] = t.translateMojomInterface(typeKey)
+ }
+
tmplFile.Imports = []Import{
Import{PackagePath: "mojo/public/go/bindings", PackageName: "bindings"},
Import{PackagePath: "fmt", PackageName: "fmt"},
@@ -173,6 +178,7 @@ func (t *translator) translateMojomInterface(typeKey string) (m *InterfaceTempla
m.Name = t.goTypeName(typeKey)
m.PrivateName = privateName(m.Name)
+ m.ServiceName = mojomInterface.ServiceName
for _, mojomMethod := range mojomInterface.Methods {
m.Methods = append(m.Methods, *t.translateMojomMethod(mojomMethod, m))
« no previous file with comments | « mojom/generators/go/translator/names.go ('k') | mojom/generators/go/translator/types.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698