From 8074f9f6179ebcfa193d2f22f2ec7892a4e58a51 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 9 Jul 2021 18:19:30 +0300 Subject: [PATCH] fix field setting Signed-off-by: Vasiliy Tolstov --- util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.go b/util.go index fb3c614..c9dc1dc 100644 --- a/util.go +++ b/util.go @@ -124,7 +124,7 @@ func newPathRequest(path string, method string, body string, msg interface{}, ta default: 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) } else { if val.Type().Kind() == reflect.Slice {