Skip to content
Snippets Groups Projects
Commit 0c9659a3 authored by Jano Hendriks's avatar Jano Hendriks
Browse files

added check for pointer value to MapParams

parent 194c805b
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,8 @@ func addStructParams(params map[string]string, structValue reflect.Value) { ...@@ -44,6 +44,8 @@ func addStructParams(params map[string]string, structValue reflect.Value) {
if t.Field(i).Type.Kind() == reflect.Slice { if t.Field(i).Type.Kind() == reflect.Slice {
jsonValue, _ := json.Marshal(structValue.Field(i).Interface()) jsonValue, _ := json.Marshal(structValue.Field(i).Interface())
params[jsonTags[0]] = string(jsonValue) params[jsonTags[0]] = string(jsonValue)
} else if t.Field(i).Type.Kind() == reflect.Ptr {
params[jsonTags[0]] = fmt.Sprintf("%v", structValue.Field(i).Elem())
} else { } else {
params[jsonTags[0]] = fmt.Sprintf("%v", structValue.Field(i).Interface()) params[jsonTags[0]] = fmt.Sprintf("%v", structValue.Field(i).Interface())
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment