chore: added defer instructions
This commit is contained in:
parent
72e5b16b7a
commit
c2e79fdcbf
@ -66,6 +66,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
|
||||
@ -95,6 +97,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,
|
||||
|
Loading…
Reference in New Issue
Block a user