diff --git a/functions.go b/functions.go index ad37a82..176ed42 100644 --- a/functions.go +++ b/functions.go @@ -65,6 +65,8 @@ func FetchData(wc *WeatherConfig, city string) (Data, error) { return Data{}, err } + defer r.Body.Close() + b, err := ioutil.ReadAll(r.Body) if err != nil { return Data{}, err @@ -93,6 +95,7 @@ func SendToInflux(wc *WeatherConfig, d Data) error { if err != nil { return err } + defer httpClient.Close() bp, err := client.NewBatchPoints(client.BatchPointsConfig{ Database: wc.InfluxDB,