Update error message in metainfo.Info.writeFiles

I think it was ripped out of some other code a long time ago.
This commit is contained in:
Matt Joiner 2017-12-29 12:18:55 +11:00
parent 5ac3e9ae54
commit a0172f7c6e
1 changed files with 2 additions and 2 deletions

View File

@ -76,8 +76,8 @@ func (info *Info) writeFiles(w io.Writer, open func(fi FileInfo) (io.ReadCloser,
}
wn, err := io.CopyN(w, r, fi.Length)
r.Close()
if wn != fi.Length || err != nil {
return fmt.Errorf("error hashing %v: %s", fi, err)
if wn != fi.Length {
return fmt.Errorf("error copying %v: %s", fi, err)
}
}
return nil