diff options
author | Joe Chen <jc@unknwon.io> | 2023-02-02 21:25:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-02 21:25:25 +0800 |
commit | c53a1998c589a544b25d53f6e6fdf0f24a4df25b (patch) | |
tree | 1c3c9d693ba551eecfbc535be942e40b5acf9cf7 /internal/httplib | |
parent | 614382fec0ba05149785539ab93560d4d42c194d (diff) |
all: replace `interface{}` with `any` (#7330)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/httplib')
-rw-r--r-- | internal/httplib/httplib.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 |