mirror of
https://github.com/kubereboot/kured.git
synced 2026-03-05 02:10:22 +00:00
Merge pull request #2 from weaveworks/panicclose
Close body after error check
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user