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:
@@ -42,7 +42,11 @@ func (d *dirFS) Open(name string) (fs.File, error) {
|
||||
|
||||
// OpenFile implements FS.OpenFile
|
||||
func (d *dirFS) OpenFile(path string, flag int, perm fs.FileMode) (platform.File, syscall.Errno) {
|
||||
return platform.OpenFile(d.join(path), flag, perm)
|
||||
f, errno := platform.OpenFile(d.join(path), flag, perm)
|
||||
if errno != 0 {
|
||||
return nil, errno
|
||||
}
|
||||
return platform.NewFsFile(path, f), 0
|
||||
}
|
||||
|
||||
// Lstat implements FS.Lstat
|
||||
|
||||
Reference in New Issue
Block a user