Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update object Put to avoid loosing last chunk
The old code might miss the last object if `Reader` return both a value and `EOF` Extract from `Reader` doc : > When Read encounters an error or end-of-file condition after successfully reading n > 0 bytes, it returns the number of bytes read. It may return the (non-nil) error from the same call or return the error (and n == 0) from a subsequent call. An instance of this general case is that a Reader returning a non-zero number of bytes at the end of the input stream may return either err == EOF or err == nil. The next Read should return 0, EOF. > > Callers should always process the n > 0 bytes returned before considering the error err. Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors.
- Loading branch information