diff --git a/pkg/notifications/slack/slack.go b/pkg/notifications/slack/slack.go index 0595daf..e01ffc1 100644 --- a/pkg/notifications/slack/slack.go +++ b/pkg/notifications/slack/slack.go @@ -29,10 +29,10 @@ func NotifyReboot(hookURL, username, nodeID string) error { } resp, err := httpClient.Post(hookURL, "application/json", &buf) - defer resp.Body.Close() if err != nil { return err } + defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { return fmt.Errorf(resp.Status)