diff --git a/sdk/storage/azblob/CHANGELOG.md b/sdk/storage/azblob/CHANGELOG.md index 0350465e8e7d..234b507fb4d1 100644 --- a/sdk/storage/azblob/CHANGELOG.md +++ b/sdk/storage/azblob/CHANGELOG.md @@ -6,6 +6,7 @@ ### Breaking Changes * Updated to latest `azcore`. Public surface area is unchanged. +* [#16978](https://github.com/Azure/azure-sdk-for-go/pull/16978): The `DownloadResponse.Body` parameter is now `*RetryReaderOptions`. ### Bugs Fixed diff --git a/sdk/storage/azblob/highlevel.go b/sdk/storage/azblob/highlevel.go index 32020716e00d..d602beda4441 100644 --- a/sdk/storage/azblob/highlevel.go +++ b/sdk/storage/azblob/highlevel.go @@ -269,7 +269,7 @@ func (b BlobClient) DownloadBlobToWriterAt(ctx context.Context, offset int64, co if err != nil { return err } - body := dr.Body(o.RetryReaderOptionsPerBlock) + body := dr.Body(&o.RetryReaderOptionsPerBlock) if o.Progress != nil { rangeProgress := int64(0) body = streaming.NewResponseProgress( diff --git a/sdk/storage/azblob/zc_response_helpers.go b/sdk/storage/azblob/zc_response_helpers.go index 9cb4436022eb..b4b853031a7a 100644 --- a/sdk/storage/azblob/zc_response_helpers.go +++ b/sdk/storage/azblob/zc_response_helpers.go @@ -50,11 +50,15 @@ type DownloadResponse struct { // while reading, it will make additional requests to reestablish a connection and // continue reading. Specifying a RetryReaderOption's with MaxRetryRequests set to 0 // (the default), returns the original response body and no retries will be performed. -func (r *DownloadResponse) Body(o RetryReaderOptions) io.ReadCloser { - if o.MaxRetryRequests == 0 { // No additional retries +// Pass in nil for options to accept the default options. +func (r *DownloadResponse) Body(options *RetryReaderOptions) io.ReadCloser { + if options == nil { + options = &RetryReaderOptions{} + } + if options.MaxRetryRequests == 0 { // No additional retries return r.RawResponse.Body } - return NewRetryReader(r.ctx, r.RawResponse, r.getInfo, o, + return NewRetryReader(r.ctx, r.RawResponse, r.getInfo, *options, func(ctx context.Context, getInfo HTTPGetterInfo) (*http.Response, error) { accessConditions := &BlobAccessConditions{ ModifiedAccessConditions: &ModifiedAccessConditions{IfMatch: &getInfo.ETag}, @@ -63,7 +67,7 @@ func (r *DownloadResponse) Body(o RetryReaderOptions) io.ReadCloser { Offset: &getInfo.Offset, Count: &getInfo.Count, BlobAccessConditions: accessConditions, - CpkInfo: o.CpkInfo, + CpkInfo: options.CpkInfo, //CpkScopeInfo: o.CpkScopeInfo, } resp, err := r.b.Download(ctx, &options) diff --git a/sdk/storage/azblob/zt_append_blob_client_test.go b/sdk/storage/azblob/zt_append_blob_client_test.go index 0001d30cb3f3..cc4596aeafcb 100644 --- a/sdk/storage/azblob/zt_append_blob_client_test.go +++ b/sdk/storage/azblob/zt_append_blob_client_test.go @@ -202,7 +202,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURL() { destData, err := ioutil.ReadAll(downloadResp.RawResponse.Body) _assert.Nil(err) _assert.Equal(destData, sourceData) - _ = downloadResp.Body(RetryReaderOptions{}).Close() + _ = downloadResp.Body(nil).Close() } //nolint @@ -294,7 +294,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithMD5() { // Check data integrity through downloading. downloadResp, err := destBlob.BlobClient.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, sourceData) diff --git a/sdk/storage/azblob/zt_blob_client_test.go b/sdk/storage/azblob/zt_blob_client_test.go index 945a4209f905..3a2a8cf966e9 100644 --- a/sdk/storage/azblob/zt_blob_client_test.go +++ b/sdk/storage/azblob/zt_blob_client_test.go @@ -183,7 +183,7 @@ func (s *azblobTestSuite) TestBlobStartCopyDestEmpty() { _assert.Nil(err) _assert.Equal(*resp.ContentLength, int64(len(blockBlobDefaultData))) _assert.Equal(string(data), blockBlobDefaultData) - _ = resp.Body(RetryReaderOptions{}).Close() + _ = resp.Body(nil).Close() } func (s *azblobTestSuite) TestBlobStartCopyMetadata() { @@ -454,7 +454,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobStartCopyUsingSASSrc() { _assert.Nil(err) _assert.Equal(*resp2.ContentLength, int64(len(blockBlobDefaultData))) _assert.Equal(string(data), blockBlobDefaultData) - _ = resp2.Body(RetryReaderOptions{}).Close() + _ = resp2.Body(nil).Close() } //nolint @@ -3473,8 +3473,8 @@ func (s *azblobUnrecordedTestSuite) TestDownloadBlockBlobUnexpectedEOF() { } //nolint -func InjectErrorInRetryReaderOptions(err error) RetryReaderOptions { - return RetryReaderOptions{ +func InjectErrorInRetryReaderOptions(err error) *RetryReaderOptions { + return &RetryReaderOptions{ MaxRetryRequests: 1, doInjectError: true, doInjectErrorRound: 0, diff --git a/sdk/storage/azblob/zt_blob_tags_test.go b/sdk/storage/azblob/zt_blob_tags_test.go index de17ca9de3b9..ec9fba1bcd72 100644 --- a/sdk/storage/azblob/zt_blob_tags_test.go +++ b/sdk/storage/azblob/zt_blob_tags_test.go @@ -200,7 +200,7 @@ func (s *azblobUnrecordedTestSuite) TestStageBlockWithTags() { contentResp, err := bbClient.Download(ctx, nil) _assert.Nil(err) - contentData, err := ioutil.ReadAll(contentResp.Body(RetryReaderOptions{})) + contentData, err := ioutil.ReadAll(contentResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(contentData, []uint8(strings.Join(data, ""))) @@ -328,7 +328,7 @@ func (s *azblobUnrecordedTestSuite) TestStageBlockFromURLWithTags() { downloadResp, err := destBlob.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, sourceData) } @@ -401,7 +401,7 @@ func (s *azblobUnrecordedTestSuite) TestCopyBlockBlobFromURLWithTags() { downloadResp, err := destBlob.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, sourceData) _assert.Equal(*downloadResp.TagCount, int64(1)) diff --git a/sdk/storage/azblob/zt_blob_versioning_test.go b/sdk/storage/azblob/zt_blob_versioning_test.go index 097428edba8c..65396637871d 100644 --- a/sdk/storage/azblob/zt_blob_versioning_test.go +++ b/sdk/storage/azblob/zt_blob_versioning_test.go @@ -144,7 +144,7 @@ func (s *azblobTestSuite) TestCreateAndDownloadBlobSpecialCharactersWithVID() { dResp, err := blobURL.WithVersionID(*resp.VersionID).Download(ctx, nil) _assert.Nil(err) - d1, err := ioutil.ReadAll(dResp.Body(RetryReaderOptions{})) + d1, err := ioutil.ReadAll(dResp.Body(nil)) _assert.Nil(err) _assert.NotEqual(*dResp.Version, "") _assert.EqualValues(string(d1), string(data[i])) @@ -398,7 +398,7 @@ func (s *azblobTestSuite) TestCreateAndDownloadBlobSpecialCharactersWithVID() { // // downloadResp, err := destBlob.BlobURL.Download(ctx, 0, CountToEnd, BlobAccessConditions{}, false, ClientProvidedKeyOptions{}) // _assert.Nil(err) -// destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) +// destData, err := ioutil.ReadAll(downloadResp.Body(nil)) // _assert.Nil(err) // _assert(destData, chk.DeepEquals, sourceData) // _assert(downloadResp.Response().Header.Get("x-ms-version-id"), chk.NotNil) @@ -502,7 +502,7 @@ func (s *azblobTestSuite) TestPutBlockListReturnsVID() { contentResp, err := bbClient.Download(ctx, nil) _assert.Nil(err) - contentData, err := ioutil.ReadAll(contentResp.Body(RetryReaderOptions{})) + contentData, err := ioutil.ReadAll(contentResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(contentData, []uint8(strings.Join(data, ""))) } diff --git a/sdk/storage/azblob/zt_block_blob_client_test.go b/sdk/storage/azblob/zt_block_blob_client_test.go index 917315d820a4..348dbcf49412 100644 --- a/sdk/storage/azblob/zt_block_blob_client_test.go +++ b/sdk/storage/azblob/zt_block_blob_client_test.go @@ -189,7 +189,7 @@ func (s *azblobUnrecordedTestSuite) TestStageBlockFromURL() { // Check data integrity through downloading. downloadResp, err := destBlob.BlobClient.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, content) } @@ -268,7 +268,7 @@ func (s *azblobUnrecordedTestSuite) TestCopyBlockBlobFromURL() { // Check data integrity through downloading. downloadResp, err := destBlob.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, content) @@ -1306,7 +1306,7 @@ func (s *azblobUnrecordedTestSuite) TestSetTierOnStageBlockFromURL() { // Check data integrity through downloading. downloadResp, err := destBlob.BlobClient.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, content) diff --git a/sdk/storage/azblob/zt_client_provided_key_test.go b/sdk/storage/azblob/zt_client_provided_key_test.go index c51d5476e2fe..0782ae9fb161 100644 --- a/sdk/storage/azblob/zt_client_provided_key_test.go +++ b/sdk/storage/azblob/zt_client_provided_key_test.go @@ -96,7 +96,7 @@ func (s *azblobTestSuite) TestPutBlockAndPutBlockListWithCPK() { getResp, err := bbClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) b := bytes.Buffer{} - reader := getResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue}) + reader := getResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue}) _, _ = b.ReadFrom(reader) _ = reader.Close() _assert.Equal(b.String(), "AAA BBB CCC ") @@ -150,7 +150,7 @@ func (s *azblobTestSuite) TestPutBlockAndPutBlockListWithCPKByScope() { getResp, err := bbClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) b := bytes.Buffer{} - reader := getResp.Body(RetryReaderOptions{}) + reader := getResp.Body(nil) _, err = b.ReadFrom(reader) _assert.Nil(err) _ = reader.Close() // The client must close the response body when finished with it @@ -273,7 +273,7 @@ func (s *azblobUnrecordedTestSuite) TestPutBlockFromURLAndCommitWithCPK() { } downloadResp, err := destBlob.BlobClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, content) _assert.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) @@ -387,7 +387,7 @@ func (s *azblobUnrecordedTestSuite) TestPutBlockFromURLAndCommitWithCPKWithScope } downloadResp, err := destBlob.BlobClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, content) _assert.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) @@ -433,7 +433,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadBlobWithMD5WithCPK() { }) _assert.Nil(err) _assert.EqualValues(downloadResp.ContentMD5, md5Val[:]) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue})) _assert.Nil(err) _assert.EqualValues(destData, srcData) _assert.EqualValues(downloadResp.EncryptionKeySHA256, testCPKByValue.EncryptionKeySHA256) @@ -471,7 +471,7 @@ func (s *azblobTestSuite) TestUploadBlobWithMD5WithCPKScope() { downloadResp, err := bbClient.BlobClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) _assert.EqualValues(downloadResp.ContentMD5, md5Val[:]) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue})) _assert.Nil(err) _assert.EqualValues(destData, srcData) _assert.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) @@ -530,7 +530,7 @@ func (s *azblobTestSuite) TestAppendBlockWithCPK() { downloadResp, err := abClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) - data, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + data, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(string(data), "AAA BBB CCC ") _assert.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) @@ -585,7 +585,7 @@ func (s *azblobTestSuite) TestAppendBlockWithCPKScope() { downloadResp, err := abClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) - data, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + data, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(string(data), "AAA BBB CCC ") _assert.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) @@ -696,7 +696,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithCPK() { _assert.Equal(*downloadResp.IsServerEncrypted, true) _assert.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue})) _assert.Nil(err) _assert.EqualValues(destData, srcData) } @@ -793,7 +793,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithCPKScope() { _assert.Equal(*downloadResp.IsServerEncrypted, true) _assert.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue})) _assert.Nil(err) _assert.EqualValues(destData, srcData) } @@ -849,7 +849,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockWithCPK() { downloadResp, err := pbClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, srcData) _assert.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) @@ -897,7 +897,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockWithCPKScope() { downloadResp, err := pbClient.Download(ctx, &downloadBlobOptions) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(nil)) _assert.Nil(err) _assert.EqualValues(destData, srcData) _assert.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) @@ -983,7 +983,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockFromURLWithCPK() { _assert.Nil(err) _assert.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue})) _assert.Nil(err) _assert.EqualValues(destData, srcData) } @@ -1059,7 +1059,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockFromURLWithCPKScope() { _assert.Nil(err) _assert.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue})) _assert.Nil(err) _assert.EqualValues(destData, srcData) } @@ -1144,7 +1144,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURLWithMD5WithCPK() { _assert.Nil(err) _assert.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{CpkInfo: &testCPKByValue})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{CpkInfo: &testCPKByValue})) _assert.Nil(err) _assert.EqualValues(destData, srcData) diff --git a/sdk/storage/azblob/zt_examples_test.go b/sdk/storage/azblob/zt_examples_test.go index f48a833a2637..a92df459be6a 100644 --- a/sdk/storage/azblob/zt_examples_test.go +++ b/sdk/storage/azblob/zt_examples_test.go @@ -102,7 +102,7 @@ func Example() { // Open a buffer, reader, and then download! downloadedData := &bytes.Buffer{} - reader := get.Body(RetryReaderOptions{}) // RetryReaderOptions has a lot of in-depth tuning abilities, but for the sake of simplicity, we'll omit those here. + reader := get.Body(nil) // RetryReaderOptions has a lot of in-depth tuning abilities, but for the sake of simplicity, we'll omit those here. _, err = downloadedData.ReadFrom(reader) if err != nil { return @@ -438,7 +438,7 @@ func ExampleBlobAccessConditions() { fmt.Print("Failure: " + stgErr.Error() + "\n") } } else { - err := response.Body(RetryReaderOptions{}).Close() + err := response.Body(nil).Close() if err != nil { return } // The client must close the response body when finished with it @@ -732,7 +732,7 @@ func ExampleBlockBlobClient() { log.Fatal(err) } blobData := &bytes.Buffer{} - reader := get.Body(RetryReaderOptions{}) + reader := get.Body(nil) _, err = blobData.ReadFrom(reader) if err != nil { return @@ -781,7 +781,7 @@ func ExampleAppendBlobClient() { log.Fatal(err) } b := bytes.Buffer{} - reader := get.Body(RetryReaderOptions{}) + reader := get.Body(nil) _, err = b.ReadFrom(reader) if err != nil { return @@ -856,7 +856,7 @@ func ExamplePageBlobClient() { log.Fatal(err) } blobData := &bytes.Buffer{} - reader := get.Body(RetryReaderOptions{}) + reader := get.Body(nil) _, err = blobData.ReadFrom(reader) if err != nil { return @@ -914,7 +914,7 @@ func Example_blobSnapshots() { log.Fatal(err) } b := bytes.Buffer{} - reader := get.Body(RetryReaderOptions{}) + reader := get.Body(nil) _, err = b.ReadFrom(reader) if err != nil { return @@ -932,7 +932,7 @@ func Example_blobSnapshots() { log.Fatal(err) } b.Reset() - reader = get.Body(RetryReaderOptions{}) + reader = get.Body(nil) _, err = b.ReadFrom(reader) if err != nil { return @@ -1024,7 +1024,7 @@ func Example_progressUploadDownload() { } // Wrap the response body in a ResponseBodyProgress and pass a callback function for progress reporting. - responseBody := streaming.NewResponseProgress(get.Body(RetryReaderOptions{}), + responseBody := streaming.NewResponseProgress(get.Body(nil), func(bytesTransferred int64) { fmt.Printf("Read %d of %d bytes.", bytesTransferred, *get.ContentLength) }) @@ -1173,7 +1173,7 @@ func ExampleBlobClient_Download() { if err != nil { log.Fatal(err) } - rs := dr.Body(RetryReaderOptions{}) + rs := dr.Body(nil) // NewResponseBodyProgress wraps the GetRetryStream with progress reporting; it returns an io.ReadCloser. stream := streaming.NewResponseProgress(rs, diff --git a/sdk/storage/azblob/zt_page_blob_client_test.go b/sdk/storage/azblob/zt_page_blob_client_test.go index c543ae255411..6aeb56a88441 100644 --- a/sdk/storage/azblob/zt_page_blob_client_test.go +++ b/sdk/storage/azblob/zt_page_blob_client_test.go @@ -133,7 +133,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURL() { // Check data integrity through downloading. downloadResp, err := destBlob.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{})) _assert.Nil(err) _assert.EqualValues(destData, sourceData) } @@ -204,7 +204,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURLWithMD5() { // Check data integrity through downloading. downloadResp, err := destBlob.Download(ctx, nil) _assert.Nil(err) - destData, err := ioutil.ReadAll(downloadResp.Body(RetryReaderOptions{})) + destData, err := ioutil.ReadAll(downloadResp.Body(&RetryReaderOptions{})) _assert.Nil(err) _assert.EqualValues(destData, sourceData)