get package name only for descriptor message typed

This commit is contained in:
jhayotte 2017-05-02 12:23:34 +02:00
parent d37b141a64
commit 266eb3707c

View File

@ -115,7 +115,10 @@ func isFieldRepeated(f *descriptor.FieldDescriptorProto) bool {
} }
func goTypeWithPackage(f *descriptor.FieldDescriptorProto) string { func goTypeWithPackage(f *descriptor.FieldDescriptorProto) string {
pkg := getPackageTypeName(*f.TypeName) pkg := ""
if *f.Type == descriptor.FieldDescriptorProto_TYPE_MESSAGE {
pkg = getPackageTypeName(*f.TypeName)
}
return goType(pkg, f) return goType(pkg, f)
} }