Registry /
other / bytecodealliance-wasmtime-go-v3
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
wasmtime
✓ github.com/bytecodealliance/wasmtime-go/v3
Compiles a simple WebAssembly module and calls an exported add function.
package main
import (
"fmt"
"github.com/bytecodealliance/wasmtime-go/v3"
)
func main() {
engine := wasmtime.NewEngine()
store := wasmtime.NewStore(engine)
wasm, _ := wasmtime.Wat2Wasm("(module (func (export \"add\") (param i32 i32) (result i32) local.get 0 local.get 1 i32.add))")
module, _ := wasmtime.NewModule(engine, wasm)
instance, _ := wasmtime.NewInstance(store, module, []wasmtime.AsExtern{})
add := instance.GetFunc(store, "add")
result, _ := add.Call(store, 1, 2)
fmt.Println(result)
}
Upgrade
Version history
3.0.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.