Removes internal dependency on fs.FS (#987)

As noted in slack, we are unlikley to long term use fs.FS internally.
This ensures we attempt to cast to syscallfs.FS for all I/O by panicing
on fs.Open.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-12-31 13:27:54 +08:00
committed by GitHub
parent 2045f71363
commit c9868d89cb
9 changed files with 161 additions and 128 deletions

View File

@@ -33,8 +33,9 @@ empty:
func Test_writefs(t *testing.T) {
t.Parallel()
tmpDir := t.TempDir()
fs, err := writefs.NewDirFS(tmpDir)
require.NoError(t, err)
fs := writefs.DirFS(tmpDir)
// test expects to write under /tmp
require.NoError(t, os.Mkdir(path.Join(tmpDir, "tmp"), 0o700))