From 219c308b785ff1fae525516ae94d11937adbaf18 Mon Sep 17 00:00:00 2001 From: Kujtim Date: Sun, 19 Nov 2017 01:40:19 +0100 Subject: [PATCH] Fix array and pointer bug --- generator/generate_service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generator/generate_service.go b/generator/generate_service.go index 0efef72..ec4aa75 100644 --- a/generator/generate_service.go +++ b/generator/generate_service.go @@ -604,7 +604,7 @@ func (g *generateServiceEndpoints) generateEndpointsClientMethods() { tp := p.Type ts := strings.Split(tp, ".") if len(ts) == 1 { - if tp[:1] == strings.ToUpper(tp[:1]) { + if tp[:1] == strings.ToUpper(tp[:1]) && tp[0] != '[' && tp[0] != '*' { // If the type of the parameter is not `something.MyType` and it starts with an uppercase // than the type was defined inside the service package. tp = "service." + tp @@ -637,7 +637,7 @@ func (g *generateServiceEndpoints) generateEndpointsClientMethods() { tp := p.Type ts := strings.Split(tp, ".") if len(ts) == 1 { - if tp[:1] == strings.ToUpper(tp[:1]) { + if tp[:1] == strings.ToUpper(tp[:1]) && tp[0] != '[' && tp[0] != '*' { // If the type of the parameter is not `something.MyType` and it starts with an uppercase // than the type was defined inside the service package. tp = "service." + tp @@ -707,7 +707,7 @@ func (g *generateServiceEndpoints) generateMethodEndpoint() (err error) { tp := p.Type ts := strings.Split(tp, ".") if len(ts) == 1 { - if tp[:1] == strings.ToUpper(tp[:1]) { + if tp[:1] == strings.ToUpper(tp[:1]) && tp[0] != '[' && tp[0] != '*' { // If the type of the parameter is not `something.MyType` and it starts with an uppercase // than the type was defined inside the service package. tp = "service." + tp @@ -738,7 +738,7 @@ func (g *generateServiceEndpoints) generateMethodEndpoint() (err error) { tp := p.Type ts := strings.Split(tp, ".") if len(ts) == 1 { - if tp[:1] == strings.ToUpper(tp[:1]) { + if tp[:1] == strings.ToUpper(tp[:1]) && tp[0] != '[' && tp[0] != '*' { // If the type of the parameter is not `something.MyType` and it starts with an uppercase // than the type was defined inside the service package. tp = "service." + tp