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)