forked from TrueCloudLab/restic
Checking err is sufficient for io.Writer
This commit is contained in:
parent
d8f752fd55
commit
6e17708dc0
1 changed files with 1 additions and 6 deletions
|
@ -131,15 +131,10 @@ func (r *DirRepository) PutRaw(buf []byte) (ID, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
wr := hashing.NewWriter(file, r.hash)
|
wr := hashing.NewWriter(file, r.hash)
|
||||||
n, err := wr.Write(buf)
|
_, err = wr.Write(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if n != len(buf) {
|
|
||||||
return nil, errors.New("not all bytes written")
|
|
||||||
}
|
|
||||||
|
|
||||||
err = file.Close()
|
err = file.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue