Merge pull request #4 from jippi/patch-1

This commit is contained in:
Dwight Donovan Benvenuto 2022-12-09 08:58:29 +01:00 committed by GitHub
commit 6ffcf60a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,6 +93,7 @@ func fetchInstance() (Instance, error) {
if err != nil { if err != nil {
return instance, err return instance, err
} }
defer res.Body.Close()
err = json.NewDecoder(res.Body).Decode(&instance) err = json.NewDecoder(res.Body).Decode(&instance)
return instance, err return instance, err
@ -104,7 +105,8 @@ func fetchActivity() (Activities, error) {
if err != nil { if err != nil {
return activities, err return activities, err
} }
defer res.Body.Close()
err = json.NewDecoder(res.Body).Decode(&activities) err = json.NewDecoder(res.Body).Decode(&activities)
return activities, err return activities, err
} }