MCPcopy Create free account
hub / github.com/dispatchrun/wazergo / MustCompile

Function MustCompile

module.go:99–105  ·  view source on GitHub ↗

MustCompile is like Compile but it panics if there is an error.

(ctx context.Context, runtime wazero.Runtime, mod HostModule[T])

Source from the content-addressed store, hash-verified

97
98// MustCompile is like Compile but it panics if there is an error.
99func MustCompile[T Module](ctx context.Context, runtime wazero.Runtime, mod HostModule[T]) *CompiledModule[T] {
100 compiledModule, err := Compile(ctx, runtime, mod)
101 if err != nil {
102 panic(err)
103 }
104 return compiledModule
105}
106
107// Instantiate creates an instance of the compiled module for in the given runtime
108//

Callers

nothing calls this directly

Calls 1

CompileFunction · 0.85

Tested by

no test coverage detected