mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-27 22:13:02 +00:00
Dedup code and migrate away from deprecated funcs (#1141)
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@@ -84,7 +84,7 @@ func (c *Client) Do(method, u string, params url.Values) ([]byte, error) {
|
||||
return nil, fmt.Errorf("%s %s respond %d", req.Method, req.URL, resp.StatusCode)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("fail to read response from %s %s: %v", req.Method, req.URL.String(), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user