MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / newComponent

Function newComponent

component_test.go:26–33  ·  view source on GitHub ↗

newComponent compiles `wat` into a fresh [Component] for tests. The returned component must be closed by the caller.

(t *testing.T, engine *Engine, wat string)

Source from the content-addressed store, hash-verified

24// newComponent compiles `wat` into a fresh [Component] for tests. The
25// returned component must be closed by the caller.
26func newComponent(t *testing.T, engine *Engine, wat string) *Component {
27 t.Helper()
28 wasm, err := Wat2Wasm(wat)
29 require.NoError(t, err)
30 component, err := NewComponent(engine, wasm)
31 require.NoError(t, err)
32 return component
33}

Calls 2

Wat2WasmFunction · 0.85
NewComponentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…