Merge pull request #425 from fkautz/pr_out_minor_cleanup_of_memory_get_partial_object

This commit is contained in:
Frederick F. Kautz IV 2015-04-01 15:51:08 -07:00
commit 07235399a1
1 changed files with 2 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import (
"encoding/hex"
"github.com/minio-io/minio/pkg/drivers"
"io/ioutil"
)
// memoryDriver - local variables
@ -85,8 +86,7 @@ func (memory memoryDriver) GetPartialObject(w io.Writer, bucket, object string,
if _, err := memory.GetObject(&sourceBuffer, bucket, object); err != nil {
return 0, err
}
var nilBuffer bytes.Buffer
if _, err := io.CopyN(&nilBuffer, &sourceBuffer, start); err != nil {
if _, err := io.CopyN(ioutil.Discard, &sourceBuffer, start); err != nil {
return 0, err
}
return io.CopyN(w, &sourceBuffer, length)