wagon icon indicating copy to clipboard operation
wagon copied to clipboard

Question/Error when use wasm-run with wasm generated from Go 1.11

Open breml opened this issue 5 years ago • 4 comments

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?

breml avatar Aug 25 '18 14:08 breml

I have the same question.

wupeaking avatar Sep 05 '18 09:09 wupeaking

I have the same question.

hunjixin avatar Jan 14 '19 06:01 hunjixin

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).

twitchyliquid64 avatar Mar 14 '19 15:03 twitchyliquid64

Anyone solve this?

guo-li-hua avatar Jan 13 '20 06:01 guo-li-hua