return a + b } //go:wasmimport add a func addA() int32 //go:wasmimport add b func addB() int32 var a, b int32 func main() { a = addA() b = addB() } import "./wasm_exec.js"; const go = new Go(); const { instance } = await WebAssembly.instantiateStreaming( fetch(new URL("main.wasm", import.meta.url)), { ...go.importObject, add: { a: () => 10, b: () => 20, }, }, ); go.run(instance); console.log(instance.exports.add());