Merge branch '19088-s3-properties-tags'
[arvados.git] / sdk / go / arvados / fs_base.go
index 0cde825b38834fffa945809c4609184b77923785..2ad4d1f859f1141035c04cb4180c5ef623d1fa04 100644 (file)
@@ -234,15 +234,14 @@ type fileinfo struct {
        mode    os.FileMode
        size    int64
        modTime time.Time
-       // Source data structure: *Collection, *Group, or
-       // nil. Currently populated only for project dirs and
-       // top-level collection dirs; *not* populated for
-       // /by_id/{uuid} dirs (only subdirs below that). Does not stay
-       // up to date with upstream changes.
+       // If not nil, sys() returns the source data structure, which
+       // can be a *Collection, *Group, or nil. Currently populated
+       // only for project dirs and top-level collection dirs. Does
+       // not stay up to date with upstream changes.
        //
        // Intended to support keep-web's properties-as-s3-metadata
        // feature (https://dev.arvados.org/issues/19088).
-       sys interface{}
+       sys func() interface{}
 }
 
 // Name implements os.FileInfo.
@@ -272,7 +271,10 @@ func (fi fileinfo) Size() int64 {
 
 // Sys implements os.FileInfo. See comment in fileinfo struct.
 func (fi fileinfo) Sys() interface{} {
-       return fi.sys
+       if fi.sys == nil {
+               return nil
+       }
+       return fi.sys()
 }
 
 type nullnode struct{}