Adds Path to platform.File and refactors tests (#1431)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
This commit is contained in:
Crypt Keeper
2023-05-04 07:05:40 +08:00
committed by GitHub
parent cf5ebf6f6b
commit e5dc733df7
22 changed files with 215 additions and 154 deletions

View File

@@ -67,7 +67,7 @@ func (r *readFS) OpenFile(path string, flag int, perm fs.FileMode) (platform.Fil
if errno != 0 {
return nil, errno
}
return &platform.DefaultFile{F: maskForReads(f.File())}, 0
return platform.NewFsFile(path, maskForReads(f.File())), 0
}
// maskForReads masks the file with read-only interfaces used by wazero.