diff --git a/utils/FalconWriter.go b/utils/FalconWriter.go index f1d7e4f..36257b0 100644 --- a/utils/FalconWriter.go +++ b/utils/FalconWriter.go @@ -58,13 +58,13 @@ func (f *FalconWriter) PushToFalcon(ms []*FalconMetric) error { } bodyReader := bytes.NewBuffer(mb) resp, err := http.Post(f.falconUrl, "application/json", bodyReader) - defer resp.Body.Close() if err != nil { f.log.Errorf("Post data to falcon failed: %s", err.Error()) return err } + defer resp.Body.Close() return nil }