From d0123f40b75e1fea17604652e336af84a9c5c2cf Mon Sep 17 00:00:00 2001 From: Guo Huang Date: Mon, 18 Apr 2016 23:30:30 -0700 Subject: [PATCH] fixed go reflection type checking issue --- .../swagger-codegen/src/main/resources/go/api_client.mustache | 2 +- samples/client/petstore/go/go-petstore/api_client.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/go/api_client.mustache b/modules/swagger-codegen/src/main/resources/go/api_client.mustache index ad2d148e052..b5656eaabf2 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_client.mustache @@ -75,7 +75,7 @@ func (c *ApiClient) CallApi(path string, method string, } func (c *ApiClient) ParameterToString (obj interface{}) string { - if reflect.TypeOf(obj).Len() > 0 { + if reflect.TypeOf(obj).String() == "[]string" { return strings.Join(obj.([]string), ",") } else{ return obj.(string) diff --git a/samples/client/petstore/go/go-petstore/api_client.go b/samples/client/petstore/go/go-petstore/api_client.go index 3440a83a9fd..e530c1d1777 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -75,7 +75,7 @@ func (c *ApiClient) CallApi(path string, method string, } func (c *ApiClient) ParameterToString (obj interface{}) string { - if reflect.TypeOf(obj).Len() > 0 { + if reflect.TypeOf(obj).String() == "[]string" { return strings.Join(obj.([]string), ",") } else{ return obj.(string)