use channel and remove logs
This commit is contained in:
3 files changed
+15
-21
No files matched your search
@@ -13,11 +13,15 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
init, done := make(chan bool), make(chan error)
|
||||
init, done := make(chan error), make(chan bool)
|
||||
go b.Run(init, done)
|
||||
<-init
|
||||
err = <-init
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
res, err := b.CallFunc("printWasm", &[]interface{}{"Hello from Go"})
|
||||
fmt.Println(res, err)
|
||||
err = <-done
|
||||
<-done
|
||||
fmt.Println("wasm exited", err)
|
||||
}
|
||||
Reference in new issue
Block a user