1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Use errcheck to find unhandled errors (#795)

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer
2019-12-17 08:26:16 -08:00
committed by GitHub
parent 04ff03ab1c
commit cde904ff08
44 changed files with 250 additions and 97 deletions

View File

@@ -95,7 +95,7 @@ func (widget *Widget) GetStandings(leagueId int) string {
if err != nil {
return fmt.Sprintf("Error fetching standings: %s", err.Error())
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return fmt.Sprintf("Error fetching standings: %s", err.Error())
@@ -141,7 +141,7 @@ func (widget *Widget) GetMatches(leagueId int) string {
if err != nil {
return fmt.Sprintf("Error fetching matches: %s", err.Error())
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return fmt.Sprintf("Error fetching matches: %s", err.Error())