lib/fs: Better equality comparison in mtimefs

This commit is contained in:
Jakob Borg 2023-12-03 16:01:46 +01:00
parent 2ae15aa454
commit 4cba99fcd4

View File

@ -88,7 +88,7 @@ func (f *mtimeFS) Stat(name string) (FileInfo, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if mtimeMapping.Real == info.ModTime() { if mtimeMapping.Real.Equal(info.ModTime()) {
info = mtimeFileInfo{ info = mtimeFileInfo{
FileInfo: info, FileInfo: info,
mtime: mtimeMapping.Virtual, mtime: mtimeMapping.Virtual,
@ -108,7 +108,7 @@ func (f *mtimeFS) Lstat(name string) (FileInfo, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if mtimeMapping.Real == info.ModTime() { if mtimeMapping.Real.Equal(info.ModTime()) {
info = mtimeFileInfo{ info = mtimeFileInfo{
FileInfo: info, FileInfo: info,
mtime: mtimeMapping.Virtual, mtime: mtimeMapping.Virtual,
@ -215,7 +215,7 @@ func (f mtimeFile) Stat() (FileInfo, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if mtimeMapping.Real == info.ModTime() { if mtimeMapping.Real.Equal(info.ModTime()) {
info = mtimeFileInfo{ info = mtimeFileInfo{
FileInfo: info, FileInfo: info,
mtime: mtimeMapping.Virtual, mtime: mtimeMapping.Virtual,