This commit is contained in:
vedhavyas committed 2019-08-22 10:05:05 -07:00
1 parent 6029286b43
commit 8300aefbed
4 files changed
+69 -1

No files matched your search

+24
View File
@@ -2,6 +2,7 @@ package main
import (
"context"
"fmt"
"log"
"github.com/vedhavyas/go-wasm"
@@ -48,4 +49,27 @@ func main() {
panic(err)
}
log.Printf("Multiplier: %v\n", mul)
res, err := b.CallFunc("getBytes", nil)
if err != nil {
panic(err)
}
bytes, err := wasm.Bytes(res)
if err != nil {
panic(err)
}
fmt.Println(bytes)
res, err = b.CallFunc("getError", nil)
if err != nil {
panic(err)
}
verr, err := wasm.Error(res)
if err != nil {
panic(err)
}
fmt.Println(verr)
}