From 818b6d2e33ba26b233f210a233b94d6cf3c796a9 Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Wed, 1 Apr 2015 15:50:55 -0700 Subject: [PATCH] Minor cleanup of memory get partial object --- pkg/drivers/memory/memory.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/drivers/memory/memory.go b/pkg/drivers/memory/memory.go index 93fb52890..3332634b1 100644 --- a/pkg/drivers/memory/memory.go +++ b/pkg/drivers/memory/memory.go @@ -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)