1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-21 23:33:03 +00:00

Checking err is sufficient for io.Writer

This commit is contained in:
Alexander Neumann 2014-05-02 21:25:40 +02:00
parent d8f752fd55
commit 6e17708dc0

View file

@ -131,15 +131,10 @@ func (r *DirRepository) PutRaw(buf []byte) (ID, error) {
}
wr := hashing.NewWriter(file, r.hash)
n, err := wr.Write(buf)
_, err = wr.Write(buf)
if err != nil {
return nil, err
}
if n != len(buf) {
return nil, errors.New("not all bytes written")
}
err = file.Close()
if err != nil {
return nil, err