This GitLab instance is undergoing maintenance and is operating in read-only mode.

You are on a read-only GitLab instance.
Commit e2d777ae authored by Adam Harrison's avatar Adam Harrison Committed by GitHub
Browse files

Merge pull request #2 from weaveworks/panicclose

Close body after error check
parents b9f583ae d3fa3ffd
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment