Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cbc4b21d62 |
@@ -25,14 +25,11 @@ func (c *HttpClient) SendGet(url string, data, out any) error {
|
||||
}
|
||||
|
||||
decoder := json.NewDecoder(res.Body)
|
||||
defer res.Body.Close()
|
||||
|
||||
err = decoder.Decode(&out)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println("return nil")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -43,8 +40,6 @@ func (c *HttpClient) SendPost(url string, data, out any) (any, error) {
|
||||
}
|
||||
|
||||
decoder := json.NewDecoder(res.Body)
|
||||
defer res.Body.Close()
|
||||
|
||||
err = decoder.Decode(out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -79,6 +74,7 @@ func (c *HttpClient) sendRequest(url, method string, data any) (*http.Response,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user