From 51a230d7fd0f8bcca5d205554e708b81e5162ca7 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 17 Sep 2020 11:46:32 +0100 Subject: [PATCH] fs: Implement UnWrapObjectInfo for getting original object out of src objects --- fs/fs.go | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. //