extism / go-sdk

Extism Go SDK - easily run WebAssembly modules in your Go applications
https://pkg.go.dev/github.com/extism/go-sdk
BSD 3-Clause "New" or "Revised" License
85 stars 10 forks source link

fix: Make sure output is copied to a buffer after a function call #7

Closed mhmd-azeez closed 1 year ago

mhmd-azeez commented 1 year ago

This fixes https://github.com/extism/go-sdk/issues/5#issuecomment-1666736435

From Wazero's docs about Memory.Read()

This returns a view of the underlying memory, not a copy. This means any writes to the slice returned are visible to Wasm, and any updates from Wasm are visible reading the returned slice.