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

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

Issue 2082173002: New go generator shakedown. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
Index: mojom/generators/go/translator/encoding_info.go
diff --git a/mojom/generators/go/translator/encoding_info.go b/mojom/generators/go/translator/encoding_info.go
index 03da44743f286d4371cdfe3ac859f9378c02b246..d89139f1da0878ac1d13a16d5106ddc8295003ca 100644
--- a/mojom/generators/go/translator/encoding_info.go
+++ b/mojom/generators/go/translator/encoding_info.go
@@ -140,33 +140,21 @@ func (t *translator) mapTypeEncodingInfo(mojomType mojom_types.MapType, level in
func (t *translator) typeRefEncodingInfo(typeRef mojom_types.TypeReference) (info EncodingInfo) {
mojomType := t.GetUserDefinedType(*typeRef.TypeKey)
- switch m := mojomType.(type) {
+ switch mojomType.(type) {
default:
panic("Unsupported type. This should never happen.")
case *mojom_types.UserDefinedTypeStructType:
- info = t.structTypeEncodingInfo(m.Value)
+ info = new(structTypeEncodingInfo)
case *mojom_types.UserDefinedTypeUnionType:
- info = t.unionTypeEncodingInfo(m.Value)
+ info = new(unionTypeEncodingInfo)
case *mojom_types.UserDefinedTypeEnumType:
- info = t.enumTypeEncodingInfo(m.Value)
+ info = new(enumTypeEncodingInfo)
+ case *mojom_types.UserDefinedTypeInterfaceType:
+ info = new(interfaceTypeEncodingInfo)
+ info.(*interfaceTypeEncodingInfo).interfaceRequest = typeRef.IsInterfaceRequest
}
if typeRef.Nullable {
info.setNullable(true)
}
return info
}
-
-func (t *translator) structTypeEncodingInfo(mojomType mojom_types.MojomStruct) (info *structTypeEncodingInfo) {
- info = new(structTypeEncodingInfo)
- return info
-}
-
-func (t *translator) unionTypeEncodingInfo(mojomType mojom_types.MojomUnion) (info *unionTypeEncodingInfo) {
- info = new(unionTypeEncodingInfo)
- return info
-}
-
-func (t *translator) enumTypeEncodingInfo(mojomType mojom_types.MojomEnum) (info *enumTypeEncodingInfo) {
- info = new(enumTypeEncodingInfo)
- return info
-}

Powered by Google App Engine
This is Rietveld 408576698