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

fs: Implement UnWrapObjectInfo for getting original object out of src objects

Nick Craig-Wood51a230d7fd0f
diff --git a/fs/fs.go b/fs/fs.go
index 53bbdb8a6..45f89a789 100644
--- a/fs/fs.go
+++ b/fs/fs.go
@@ -1143,6 +1143,16 @@ func UnWrapObject(o Object) Object {
return o
}
+// UnWrapObjectInfo returns the underlying Object unwrapped as much as
+// possible or nil.
+func UnWrapObjectInfo(oi ObjectInfo) Object {
+ o, ok := oi.(Object)
+ if !ok {
+ return nil
+ }
+ return UnWrapObject(o)
+}
+
// Find looks for a RegInfo object for the name passed in. The name
// can be either the Name or the Prefix.
//