diff --git a/dropbox/dropbox.go b/dropbox/dropbox.go index a9b07610e..1f0463dc5 100644 --- a/dropbox/dropbox.go +++ b/dropbox/dropbox.go @@ -207,11 +207,12 @@ func (f *Fs) setRoot(root string) { // Return an Object from a path // // If it can't be found it returns the error fs.ErrorObjectNotFound. -func (f *Fs) newObjectWithInfo(remote string, info *dropbox.Entry) (o *Object, err error) { - o = &Object{ +func (f *Fs) newObjectWithInfo(remote string, info *dropbox.Entry) (fs.Object, error) { + o := &Object{ fs: f, remote: remote, } + var err error if info != nil { err = o.setMetadataFromEntry(info) } else { diff --git a/yandex/yandex.go b/yandex/yandex.go index cbb8ed6a9..6e9b58b30 100644 --- a/yandex/yandex.go +++ b/yandex/yandex.go @@ -327,11 +327,12 @@ func (f *Fs) NewObject(remote string) (fs.Object, error) { // Return an Object from a path // // If it can't be found it returns the error fs.ErrorObjectNotFound. -func (f *Fs) newObjectWithInfo(remote string, info *yandex.ResourceInfoResponse) (o *Object, err error) { - o = &Object{ +func (f *Fs) newObjectWithInfo(remote string, info *yandex.ResourceInfoResponse) (fs.Object, error) { + o := &Object{ fs: f, remote: remote, } + var err error if info != nil { err = o.setMetaData(info) } else {