|
|
@@ -45,7 +45,7 @@ func (r *request) Get(path string) (io.ReadCloser, error) {
|
|
|
return r.execute(http.MethodGet, path, nil)
|
|
|
}
|
|
|
|
|
|
-func (r *request) Post(path string, data interface{}) (io.ReadCloser, error) {
|
|
|
+func (r *request) Post(path string, data any) (io.ReadCloser, error) {
|
|
|
return r.execute(http.MethodPost, path, data)
|
|
|
}
|
|
|
|
|
|
@@ -53,7 +53,7 @@ func (r *request) PostFile(path string, f io.ReadCloser) (io.ReadCloser, error)
|
|
|
return r.execute(http.MethodPost, path, f)
|
|
|
}
|
|
|
|
|
|
-func (r *request) Put(path string, data interface{}) (io.ReadCloser, error) {
|
|
|
+func (r *request) Put(path string, data any) (io.ReadCloser, error) {
|
|
|
return r.execute(http.MethodPut, path, data)
|
|
|
}
|
|
|
|
|
|
@@ -62,7 +62,7 @@ func (r *request) Delete(path string) error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-func (r *request) execute(method, path string, data interface{}) (io.ReadCloser, error) {
|
|
|
+func (r *request) execute(method, path string, data any) (io.ReadCloser, error) {
|
|
|
if r.endpoint == "" {
|
|
|
return nil, ErrEmptyEndpoint
|
|
|
}
|
|
|
@@ -160,7 +160,7 @@ func (r *request) buildHeaders() http.Header {
|
|
|
return headers
|
|
|
}
|
|
|
|
|
|
-func (r *request) toJSON(v interface{}) []byte {
|
|
|
+func (r *request) toJSON(v any) []byte {
|
|
|
b, err := json.Marshal(v)
|
|
|
if err != nil {
|
|
|
log.Println("Unable to convert interface to JSON:", err)
|