Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

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

Open
breml opened this issue Aug 25, 2018 · 4 comments
Open

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

breml opened this issue Aug 25, 2018 · 4 comments

Comments

@breml
Copy link

breml commented Aug 25, 2018

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?

@wupeaking
Copy link

I have the same question.

1 similar comment
@hunjixin
Copy link

I have the same question.

@twitchyliquid64
Copy link
Contributor

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

@guo-li-hua
Copy link

Anyone solve this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants