Skip to content

docs(wasi): make wasmimport example a declaration-only import - #508

Open
duaneday wants to merge 1 commit into
tinygo-org:devfrom
duaneday:docs/fix-wasi-wasmimport-body-5572
Open

docs(wasi): make wasmimport example a declaration-only import#508
duaneday wants to merge 1 commit into
tinygo-org:devfrom
duaneday:docs/fix-wasi-wasmimport-body-5572

Conversation

@duaneday

@duaneday duaneday commented Aug 8, 2026

Copy link
Copy Markdown

Summary

The "Using WASI" guide showed a //go:wasmimport function with a body. TinyGo rejects that (can only use //go:wasmimport on declarations), so the documented example does not compile.

Changes

  • Make add a declaration-only import (no body).
  • Note that the host provides the implementation.

Test plan

  • Example matches TinyGo's //go:wasmimport rules
  • GOOS=wasip1 GOARCH=wasm tinygo build -o main.wasm main.go succeeds for the snippet

Fixes tinygo-org/tinygo#5572

Signed-off-by: bath-jeromem-4272 <bath-jeromem-4272@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example "Using WASI" doesn't compile

1 participant