Is it possible to explicitly call an exported Go WebAssembly function from JS?
问题 Is it possible to call a Go WebAssembly function, other than main , in Javascript? Let me first show what I did. My Go functions are defined as follows: package main import "fmt" func main() { fmt.Println("it works!") } func add(a, b int) int { return a + b } I can only invoke the main function: const go = new Go(); const data = await fetch("http://localhost:3333/main.wasm"); const result = await WebAssembly.instantiateStreaming(data, go.importObject); go.run(result.instance); which returns