我使用以下命令将 Golang 代码编译为 wasm
GOOS=js GOARCH=wasm go build -o main.wasm
Run Code Online (Sandbox Code Playgroud)
尝试使用 wasmtime 执行时出现以下错误
wasmtime main.wasm
Error: failed to run main module `main.wasm`
Caused by:
0: failed to instantiate "main.wasm"
1: unknown import: `go::debug` has not been defined
Run Code Online (Sandbox Code Playgroud)
当使用 wasm3 执行时,我得到
wasm3 main.wasm
Error: function lookup failed ('_start')
Run Code Online (Sandbox Code Playgroud)
这些错误意味着什么以及如何修复它们?