fixed go reflection type checking issue

This commit is contained in:
Guo Huang 2016-04-18 23:30:30 -07:00
parent b57d27d3fc
commit d0123f40b7
2 changed files with 2 additions and 2 deletions

View File

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

View File

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