fix field setting

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-07-09 18:19:30 +03:00
parent e497b5fa89
commit 8074f9f617

View File

@ -124,7 +124,7 @@ func newPathRequest(path string, method string, body string, msg interface{}, ta
default: default:
fieldsmap[t.name] = fmt.Sprintf("%v", val.Interface()) fieldsmap[t.name] = fmt.Sprintf("%v", val.Interface())
} }
} else if (body == "*" || body == t.name) && method != http.MethodGet { } else if (body == "*" || body == t.name) && method != http.MethodGet && tnmsg.Field(i).CanSet() {
tnmsg.Field(i).Set(val) tnmsg.Field(i).Set(val)
} else { } else {
if val.Type().Kind() == reflect.Slice { if val.Type().Kind() == reflect.Slice {