File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ // Copyright 2014-2018 Spectra Logic Corporation. All Rights Reserved.
2+ // Licensed under the Apache License, Version 2.0 (the "License"). You may not use
3+ // this file except in compliance with the License. A copy of the License is located at
4+ //
5+ // http://www.apache.org/licenses/LICENSE-2.0
6+ //
7+ // or in the "license" file accompanying this file.
8+ // This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+ // specific language governing permissions and limitations under the License.
11+
12+ package ds3_integration
13+
14+ import "io"
15+
16+ type nilReadSizer struct {
17+ reader io.Reader
18+ fileSize int64
19+ }
20+
21+ func newNilReadSizer (reader io.Reader , fileSize int64 ) nilReadSizer {
22+ return nilReadSizer { reader : reader , fileSize : fileSize }
23+ }
24+
25+ func (readSizer * nilReadSizer ) Read (p []byte ) (n int , err error ) {
26+ return readSizer .reader .Read (p )
27+ }
28+
29+ func (readSizer * nilReadSizer ) Size () (int64 , error ) {
30+ return readSizer .fileSize , nil
31+ }
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import (
2222 "bytes"
2323 "spectra/ds3_go_sdk/ds3_utils/ds3Testing"
2424 "strconv"
25- "spectra/core/ioutils"
2625)
2726
2827var client * ds3.Client
@@ -481,7 +480,7 @@ func TestPuttingFolder(t *testing.T) {
481480
482481 const folderPath = "Gracie/Eskimo/"
483482
484- readSizer := ioutils . NewReadSizer (nil , 0 )
483+ readSizer := newNilReadSizer (nil , 0 )
485484 putObjectRequest := models .NewPutObjectRequest (bucketName , folderPath , & readSizer )
486485 _ , err = client .PutObject (putObjectRequest )
487486 ds3Testing .AssertNilError (t , err )
You can’t perform that action at this time.
0 commit comments