Skip to content

Commit

Permalink
service/s3/s3manager: Fix return signature from conflicting changes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail authored Oct 1, 2019
1 parent 11a6d37 commit 51d362f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions service/s3/s3manager/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,21 +467,21 @@ func (u *uploader) nextReader() (io.ReadSeeker, int, func(), error) {

default:
part := u.cfg.partPool.Get().([]byte)
cleanup := func() {
u.cfg.partPool.Put(part)
}

n, err := readFillBuf(r, part)
if n < 0 {
if err == nil {
err = fmt.Errorf(
"unable to read part, got negative bytes read(%d) without error, %v",
n, err)
}
return nil, n, err
return nil, n, cleanup, err
}
u.readerPos += int64(n)

cleanup := func() {
u.cfg.partPool.Put(part)
}

return bytes.NewReader(part[0:n]), n, cleanup, err
}
}
Expand Down

0 comments on commit 51d362f

Please sign in to comment.