From 8bae3c1ad26d4afcde94c5c7d1092f97741e5d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:40:16 +0900 Subject: [PATCH] fix multipart --- http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http.go b/http.go index 4bce4c5..f2a46bc 100644 --- a/http.go +++ b/http.go @@ -120,7 +120,7 @@ func WriteBodyByMultipartFormData(params ...any) (*bytes.Buffer, string, error) if err != nil { return nil, "", err } - if rx.Elem().Kind() == reflect.Struct { // 使用 json 编码 + if rx.Kind() == reflect.Pointer && rx.Elem().Kind() == reflect.Struct { // 使用 json 编码 err = json.NewEncoder(r).Encode(x) if err != nil { return nil, "", err