Adds MustInstantiate to host imports (#814)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-09-28 16:21:30 +08:00
committed by GitHub
parent 429334cf98
commit 1561c4ca7b
17 changed files with 53 additions and 50 deletions

View File

@@ -35,9 +35,7 @@ func Example() {
// Instantiate WASI, which implements host functions needed for TinyGo to
// implement `panic`.
if _, err := wasi_snapshot_preview1.Instantiate(ctx, r); err != nil {
log.Panicln(err)
}
wasi_snapshot_preview1.MustInstantiate(ctx, r)
// Instantiate the guest Wasm into the same runtime. It exports the `add`
// function, implemented in WebAssembly.