multi target copy

This commit is contained in:
Anand Babu (AB) Periasamy
2015-04-04 14:07:45 -07:00
parent 3b49d62fe6
commit 97ef5809ff
3 changed files with 90 additions and 103 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ func (c *s3Client) Put(bucket, key string, size int64, contents io.Reader) error
// Memory where data is present
sink := new(bytes.Buffer)
mw := io.MultiWriter(h, sink)
written, err := io.Copy(mw, contents)
written, err := io.CopyN(mw, contents, size)
if written != size {
return errors.New("Data read mismatch")
}