fs: adds string for better error experience (#1042)

This prepares for pseudo-root when the CLI doesn't provide one by
improving the error messages in general, as well being consistent about
parameter order.

Signed-off-by: Adrian Cole <adrian@tetrate.io>

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2023-01-17 10:01:51 -06:00
committed by GitHub
parent 3609d74c92
commit 3cf29f9f76
21 changed files with 290 additions and 128 deletions

View File

@@ -45,7 +45,7 @@ func Test_testfs(t *testing.T) {
require.NoError(t, os.Mkdir(testfsDir, 0o700))
require.NoError(t, fstest.WriteTestFiles(testfsDir))
rootFS, err := syscallfs.NewDirFS("/", tmpDir)
rootFS, err := syscallfs.NewDirFS(tmpDir, "/")
require.NoError(t, err)
stdout, stderr, err := compileAndRun(testCtx, "testfs", wazero.NewModuleConfig().WithFS(rootFS))