You cannot use WASI with Go's js/wasm target because the Go compiler only supports the browser environment for WebAssembly. The js/wasm build target (GOOS=js GOARCH=wasm) generates code that relies on browser JavaScript glue code and does not support system calls required by WASI. To run Go on WASI, you must use the wasm/wasi target instead. Run the following command to compile your Go program for WASI:
GOOS=wasip1 GOARCH=wasm go build -o main.wasm main.go