From c53a1998c589a544b25d53f6e6fdf0f24a4df25b Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Thu, 2 Feb 2023 21:25:25 +0800 Subject: all: replace `interface{}` with `any` (#7330) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/httplib/httplib.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/httplib/httplib.go') diff --git a/internal/httplib/httplib.go b/internal/httplib/httplib.go index 438b4a69..6e16d0ae 100644 --- a/internal/httplib/httplib.go +++ b/internal/httplib/httplib.go @@ -220,7 +220,7 @@ func (r *Request) PostFile(formname, filename string) *Request { // Body adds request raw body. // it supports string and []byte. -func (r *Request) Body(data interface{}) *Request { +func (r *Request) Body(data any) *Request { switch t := data.(type) { case string: bf := bytes.NewBufferString(t) @@ -414,7 +414,7 @@ func (r *Request) ToFile(filename string) error { // ToJson returns the map that marshals from the body bytes as json in response . // it calls Response inner. -func (r *Request) ToJson(v interface{}) error { +func (r *Request) ToJson(v any) error { data, err := r.Bytes() if err != nil { return err @@ -424,7 +424,7 @@ func (r *Request) ToJson(v interface{}) error { // ToXml returns the map that marshals from the body bytes as xml in response . // it calls Response inner. -func (r *Request) ToXml(v interface{}) error { +func (r *Request) ToXml(v any) error { data, err := r.Bytes() if err != nil { return err -- cgit v1.2.3