// read the contents of an object as a string func readObject(t *testing.T, obj fs.Object, options ...fs.OpenOption) string { in, err := obj.Open(options...) require.NoError(t, err) contents, err := ioutil.ReadAll(in) require.NoError(t, err) err = in.Close() require.NoError(t, err) return string(contents) }
func newReadFileHandle(o fs.Object) (*ReadFileHandle, error) { r, err := o.Open() if err != nil { return nil, err } return &ReadFileHandle{ r: r, o: o, }, nil }
func newReadFileHandle(o fs.Object) (*ReadFileHandle, error) { r, err := o.Open() if err != nil { return nil, err } fh := &ReadFileHandle{ o: o, r: fs.NewAccount(r, o), // account the transfer } fs.Stats.Transferring(fh.o.Remote()) return fh, nil }