From f6ab94027c49ce3c7250d2f376017d489b1d9e95 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 4 Mar 2022 11:36:23 +0300 Subject: [PATCH] [#128] downloader: Avoid var naming collision Signed-off-by: Leonard Lyubich --- downloader/download.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/downloader/download.go b/downloader/download.go index 1718db8..da09223 100644 --- a/downloader/download.go +++ b/downloader/download.go @@ -158,15 +158,15 @@ func (r request) receiveFile(clnt pool.Object, objectAddress *address.Address) { } // reset payload reader since part of the data has been read - var r io.Reader = bytes.NewReader(payloadHead) + var headReader io.Reader = bytes.NewReader(payloadHead) if err != io.EOF { // otherwise, we've already read full payload - r = io.MultiReader(r, rObj.Payload) + headReader = io.MultiReader(headReader, rObj.Payload) } // note: we could do with io.Reader, but SetBodyStream below closes body stream // if it implements io.Closer and that's useful for us. - rObj.Payload = readCloser{r, rObj.Payload} + rObj.Payload = readCloser{headReader, rObj.Payload} } r.SetContentType(contentType)