diff --git a/download.go b/download.go index 4ec60e6..67dd493 100644 --- a/download.go +++ b/download.go @@ -255,13 +255,13 @@ func bindFiles(c *DownloadConfig, partialDir string) error { return errors.Wrapf(err, "failed to open %q in download location", name) } - defer subfp.Close() - proxy := bar.NewProxyReader(subfp) if _, err := io.Copy(f, proxy); err != nil { return errors.Wrapf(err, "failed to copy %q", name) } + subfp.Close() + // remove a file in download location for join if err := os.Remove(name); err != nil { return errors.Wrapf(err, "failed to remove %q in download location", name)