build: fix errors spotted by ineffassign linter

These were mostly caused by shadowing err and a good fraction of them
will have caused errors not to be propagated properly.
This commit is contained in:
Nick Craig-Wood
2018-05-04 15:19:50 +01:00
parent 790a8a9aed
commit cb5bd47e61
19 changed files with 37 additions and 22 deletions

View File

@ -446,7 +446,6 @@ func (w *worker) run() {
continue
}
}
err = nil
} else {
if w.r.storage().HasChunk(w.r.cachedObject, chunkStart) {
continue
@ -493,7 +492,7 @@ func (w *worker) download(chunkStart, chunkEnd int64, retry int) {
}
data = make([]byte, chunkEnd-chunkStart)
sourceRead := 0
var sourceRead int
sourceRead, err = io.ReadFull(w.rc, data)
if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {
fs.Errorf(w, "failed to read chunk %v: %v", chunkStart, err)