From 37fe30907ae1845238df1d9ca2906374606f55e3 Mon Sep 17 00:00:00 2001 From: Valerio Gheri Date: Fri, 9 Jun 2017 11:53:33 +0200 Subject: [PATCH] Fixes #5 --- helpers/helpers.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helpers/helpers.go b/helpers/helpers.go index 3c1f3ed..bb3437d 100644 --- a/helpers/helpers.go +++ b/helpers/helpers.go @@ -185,6 +185,11 @@ func goType(pkg string, f *descriptor.FieldDescriptorProto) string { } return "uint64" case descriptor.FieldDescriptorProto_TYPE_INT32: + if *f.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED { + return "[]int32" + } + return "int32" + case descriptor.FieldDescriptorProto_TYPE_UINT32: if *f.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED { return "[]uint32" } @@ -212,11 +217,6 @@ func goType(pkg string, f *descriptor.FieldDescriptorProto) string { return "[]byte" } return "byte" - case descriptor.FieldDescriptorProto_TYPE_UINT32: - if *f.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED { - return "[]uint32" - } - return "uint32" case descriptor.FieldDescriptorProto_TYPE_ENUM: return fmt.Sprintf("*%s.%s", pkg, shortType(*f.TypeName)) default: