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:
@@ -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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package add
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user