From 79335bfcff6a790663751a9c52d958465aebcd3b Mon Sep 17 00:00:00 2001 From: bath-jeromem-4272 Date: Sat, 8 Aug 2026 13:26:20 +0200 Subject: [PATCH] docs(wasi): make wasmimport example a declaration-only import Signed-off-by: bath-jeromem-4272 --- content/docs/guides/webassembly/wasi.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/docs/guides/webassembly/wasi.md b/content/docs/guides/webassembly/wasi.md index 007af232..a7516ad1 100644 --- a/content/docs/guides/webassembly/wasi.md +++ b/content/docs/guides/webassembly/wasi.md @@ -17,14 +17,15 @@ Here is a small TinyGo program for use within a WASI host application: package main //go:wasmimport yourmodulename add -func add(x, y uint32) uint32 { - return x + y -} +func add(x, y uint32) uint32 // main is required for the `wasip1` target, even if it isn't used. func main() {} ``` +`//go:wasmimport` may only appear on function declarations without a body (the +implementation is provided by the host). + To compile the above TinyGo program for use on any WASI runtime: ```shell