]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Update error message in metainfo.Info.writeFiles
authorMatt Joiner <anacrolix@gmail.com>
Fri, 29 Dec 2017 01:18:55 +0000 (12:18 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 29 Dec 2017 01:18:55 +0000 (12:18 +1100)
I think it was ripped out of some other code a long time ago.

metainfo/info.go

index 77cb9eba4ad97a8081547278f84af215586ec9eb..22aca56f9b9afd8d3b01cdbda3389c13770fa550 100644 (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