Files
wazero/wasi/example_test.go
Crypt Keeper 106f96b066 Adds import-go example (#466)
This shows how to define, export and import functions written in Go.

Fixes #464

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-04-15 09:31:52 +08:00

15 lines
385 B
Go

package wasi
import "github.com/tetratelabs/wazero"
var r = wazero.NewRuntime()
// Example_InstantiateSnapshotPreview1 shows how to instantiate ModuleSnapshotPreview1, which allows other modules to
// import functions such as "wasi_snapshot_preview1" "fd_write".
func Example_instantiateSnapshotPreview1() {
wm, _ := InstantiateSnapshotPreview1(r)
defer wm.Close()
// Output:
}