diff options
-rw-r--r-- | hugofs/fileinfo.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hugofs/fileinfo.go b/hugofs/fileinfo.go index 17fb62ea2..4f318205a 100644 --- a/hugofs/fileinfo.go +++ b/hugofs/fileinfo.go @@ -264,7 +264,8 @@ func mergeFileMeta(from, to FileMeta) { } type dirNameOnlyFileInfo struct { - name string + name string + modTime time.Time } func (fi *dirNameOnlyFileInfo) Name() string { @@ -280,7 +281,7 @@ func (fi *dirNameOnlyFileInfo) Mode() os.FileMode { } func (fi *dirNameOnlyFileInfo) ModTime() time.Time { - return time.Now() + return fi.modTime } func (fi *dirNameOnlyFileInfo) IsDir() bool { @@ -303,7 +304,7 @@ func newDirNameOnlyFileInfo(name string, meta FileMeta, fileOpener func() (afero m[metaKeyIsOrdered] = false return NewFileMetaInfo( - &dirNameOnlyFileInfo{name: base}, + &dirNameOnlyFileInfo{name: base, modTime: time.Now()}, m, ) } |