Skip to content

Commit

Permalink
Fix shadowing err variable in downloadFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Sioro-Neoku committed May 28, 2016
1 parent 5729a7a commit a17abde
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ func downloadFile(URL string) (fileName string, err error) {
}

defer func() {
if err = file.Close(); err != nil {
log.Printf("Error closing torrent file: %s", err)
if ferr := file.Close(); ferr != nil {
log.Printf("Error closing torrent file: %s", ferr)
}
}()

Expand All @@ -315,8 +315,8 @@ func downloadFile(URL string) (fileName string, err error) {
}

defer func() {
if err = response.Body.Close(); err != nil {
log.Printf("Error closing torrent file: %s", err)
if ferr := response.Body.Close(); ferr != nil {
log.Printf("Error closing torrent file: %s", ferr)
}
}()

Expand Down

0 comments on commit a17abde

Please sign in to comment.