mirror of
https://github.com/pgsty/minio.git
synced 2026-07-25 15:06:17 +03:00
tests: Unit tests and fixes for copyBuffer. (#2333)
- Unit tests for copyBuffer. - Shadowing fix for copyBuffer.
This commit is contained in:
committed by
Harshavardhana
parent
8d090a20ce
commit
9baf599c91
+3
-4
@@ -163,10 +163,9 @@ func copyBuffer(writer io.Writer, disk StorageAPI, volume string, path string, b
|
||||
for {
|
||||
n, err := disk.ReadFile(volume, path, startOffset, buf)
|
||||
if n > 0 {
|
||||
var m int
|
||||
m, err = writer.Write(buf[:n])
|
||||
if err != nil {
|
||||
return err
|
||||
m, wErr := writer.Write(buf[:n])
|
||||
if wErr != nil {
|
||||
return wErr
|
||||
}
|
||||
if int64(m) != n {
|
||||
return io.ErrShortWrite
|
||||
|
||||
Reference in New Issue
Block a user