From 2b12e189eeec0e4f2968e974cf25419bcb071b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 5 Aug 2024 19:03:31 +0200 Subject: [PATCH] Improves ImportResolver example (#2299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Erik Pedersen --- experimental/importresolver_example_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/experimental/importresolver_example_test.go b/experimental/importresolver_example_test.go index 3c48212f0d..10b3dc8a81 100644 --- a/experimental/importresolver_example_test.go +++ b/experimental/importresolver_example_test.go @@ -43,19 +43,20 @@ func Example_importResolver() { wasi_snapshot_preview1.MustInstantiate(ctx, r) + idm, err := r.CompileModule(ctx, inoutdispatcherWasm) + if err != nil { + log.Panicln(err) + } + idcm, err := r.CompileModule(ctx, inoutdispatcherclientWasm) + if err != nil { + log.Panicln(err) + } + const numInstances = 3 mods := make([]*mod, numInstances) for i := range mods { mods[i] = &mod{} m := mods[i] - idm, err := r.CompileModule(ctx, inoutdispatcherWasm) - if err != nil { - log.Panicln(err) - } - idcm, err := r.CompileModule(ctx, inoutdispatcherclientWasm) - if err != nil { - log.Panicln(err) - } const inoutDispatcherModuleName = "inoutdispatcher"