wagon
wagon copied to clipboard
Question/Error when use wasm-run with wasm generated from Go 1.11
Go 1.11 is released an provides native wasm support. So I tried the following:
Given the following Go program main.go
package main
func main() {
}
is compiled with Go 1.11 to wasm
GOARCH=wasm GOOS=js go build -o test.wasm main.go
and try to run it with wasm-run test.wasm
I get the following error:
wasm-run: could not read module: open go.wasm: no such file or directory
So my question is, where do I get the file go.wasm
? Would this be something like the wasm_exec.js
, which is provided with Go 1.11?
I have the same question.
I have the same question.
What happens if you rename test.wasm
to go.wasm
and run it with wasm-run go.wasm
?
In any case, the current implementation of the Go compiler produces wasm that expects to be run in a browser - I would expect some error unless you mock in the equivalent APIs as what the browser provides to webassembly code (in the form of function tables).
Anyone solve this?