tinygo
tinygo copied to clipboard
wasi: implement readdir
Until readdir is implemented in wasm, we can't re-use go's utilities for testing for bugs in impl.
2022/01/01 00:00:00 TestFS err: TestFS found errors:
.: ReadDir(-1): readdir unimplemented : errno 54
Here's what would be nice to be able to both compile and run (right now, it compiles but can't run).
package main
import (
"fmt"
"log"
"os"
"syscall"
"testing/fstest"
)
func main() {
if err := fstest.TestFS(os.DirFS("sub"), "test.txt"); err != nil {
log.Panicln("TestFS err:", err)
}
fmt.Println("TestFS ok")
}
Maybe implementing needs a change here https://github.com/tinygo-org/tinygo/blob/d984b55311a2acd6c1b14ef6e87ee280e737a925/src/syscall/syscall_libc_wasi.go#L263-L265