Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

dropbox, yandex: fix return of wrapped nil introduced in 79e3c67bbdb0722fd211a67f8a7c5c034a655a15

Nick Craig-Wood5b6dd3630782
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 {