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) }