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>
This commit is contained in:
Crypt Keeper
2022-04-15 09:31:52 +08:00
committed by GitHub
parent 556cfa1967
commit 106f96b066
20 changed files with 222 additions and 26 deletions

View File

@@ -1,3 +1,3 @@
## Basic example
This example shows how to use WebAssembly and Go-defined functions with wazero.
This example shows how to use both WebAssembly and Go-defined functions with wazero.

View File

@@ -1,4 +1,4 @@
package main
package add
import (
_ "embed"

View File

@@ -1,4 +1,4 @@
package main
package add
import (
"os"
@@ -6,8 +6,7 @@ import (
// Example_main ensures the following will work:
//
// go build add.go
// ./add 7 9
// go run add.go 7 9
func Example_main() {
// Save the old os.Args and replace with our example input.