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>
15 lines
385 B
Go
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:
|
|
}
|