1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Don't use defer in a loop

As the body of request isn't used, we can sloe it immediately.
This commit is contained in:
jvoisin 2025-01-20 16:13:54 +01:00 committed by Frédéric Guillot
parent 60e1d9e361
commit 736f8b4dac
2 changed files with 2 additions and 2 deletions

View file

@ -82,7 +82,7 @@ func (c *Client) SendDiscordMsg(feed *model.Feed, entries model.Entries) error {
if err != nil {
return fmt.Errorf("discord: unable to send request: %v", err)
}
defer response.Body.Close()
response.Body.Close()
if response.StatusCode >= 400 {
return fmt.Errorf("discord: unable to send a notification: url=%s status=%d", c.webhookURL, response.StatusCode)