From 266eb3707c5e43629c18ac27a3f8239049892aa5 Mon Sep 17 00:00:00 2001 From: jhayotte Date: Tue, 2 May 2017 12:23:34 +0200 Subject: [PATCH] get package name only for descriptor message typed --- helpers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helpers.go b/helpers.go index 6b0c2df..4c1a4ab 100644 --- a/helpers.go +++ b/helpers.go @@ -115,7 +115,10 @@ func isFieldRepeated(f *descriptor.FieldDescriptorProto) bool { } 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) }