From c874ef8ee22953f6910121ddb8cfdf7c0cd187f6 Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Fri, 4 Sep 2026 19:02:30 -0500 Subject: [PATCH] docs: fix WASI guide example to use //go:wasmexport //go:wasmimport declares a host function and is only valid on declarations without a body, so the example fails to compile: main.go:4:6: can only use //go:wasmimport on declarations The example defines a function for the host to call, which is //go:wasmexport. --- content/docs/guides/webassembly/wasi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/guides/webassembly/wasi.md b/content/docs/guides/webassembly/wasi.md index 007af232..c88cfaf4 100644 --- a/content/docs/guides/webassembly/wasi.md +++ b/content/docs/guides/webassembly/wasi.md @@ -16,7 +16,7 @@ Here is a small TinyGo program for use within a WASI host application: ```go package main -//go:wasmimport yourmodulename add +//go:wasmexport add func add(x, y uint32) uint32 { return x + y }