Skip to content

Commit

Permalink
Downloader: don't shadow err
Browse files Browse the repository at this point in the history
Fixes #22.
  • Loading branch information
mook-as committed Mar 3, 2022
1 parent 002fb14 commit b1baf0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/downloader/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ func (d *Downloder) download(desc, urlToGet, destination string, mode os.FileMod
linkErr, ok := err.(*os.LinkError)
if ok {
fmt.Fprintf(os.Stderr, "Cross-device error trying to rename a file: %s -- will do a full copy\n", linkErr)
tempInput, err := ioutil.ReadFile(tmpname)
var tempInput []byte
tempInput, err = ioutil.ReadFile(tmpname)
if err != nil {
return fmt.Errorf("Error reading temporary file %s: %v",
tmpname, err)
Expand Down

0 comments on commit b1baf0a

Please sign in to comment.