diff options
Diffstat (limited to 'internal/httplib/httplib.go')
-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 |