From efd710a6523cf9e18d1fc4aac4d1caeeba4f8658 Mon Sep 17 00:00:00 2001 From: Sun XingBo Date: Thu, 22 Jul 2021 13:07:17 +0800 Subject: [PATCH] rename Marshal to JSONMarshal --- client/httplib/httplib.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/httplib/httplib.go b/client/httplib/httplib.go index 34ddd1da..5be4598b 100644 --- a/client/httplib/httplib.go +++ b/client/httplib/httplib.go @@ -340,7 +340,7 @@ func (b *BeegoHTTPRequest) YAMLBody(obj interface{}) (*BeegoHTTPRequest, error) // JSONBody adds the request raw body encoded in JSON. func (b *BeegoHTTPRequest) JSONBody(obj interface{}) (*BeegoHTTPRequest, error) { if b.req.Body == nil && obj != nil { - byts, err := b.Marshal(obj) + byts, err := b.JSONMarshal(obj) if err != nil { return b, berror.Wrap(err, InvalidJSONBody, "obj could not be converted to JSON body") } @@ -351,7 +351,7 @@ func (b *BeegoHTTPRequest) JSONBody(obj interface{}) (*BeegoHTTPRequest, error) return b, nil } -func (b *BeegoHTTPRequest) Marshal(obj interface{}) ([]byte, error) { +func (b *BeegoHTTPRequest) JSONMarshal(obj interface{}) ([]byte, error) { bf := bytes.NewBuffer([]byte{}) jsonEncoder := json.NewEncoder(bf) jsonEncoder.SetEscapeHTML(b.setting.EscapeHTML)