From bf158dbeaaa495dc258c590c7a21cf9e25e76ee7 Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Wed, 10 Jan 2024 18:11:53 -0300 Subject: [PATCH] better wording Change-Id: I045ce5dfb4ea28344a387ce0bb18392c6d0d5a9a --- src/cmd/compile/doc.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cmd/compile/doc.go b/src/cmd/compile/doc.go index 2d77bd65c6..507899e222 100644 --- a/src/cmd/compile/doc.go +++ b/src/cmd/compile/doc.go @@ -295,16 +295,15 @@ The declaration of lower.f may also have a linkname directive with a single argument, f. This is optional, but helps alert the reader that the function is accessed from outside the package. - //go:wasmimport importmodule importname + //go:wasmimport importmodule importname -The //go:wasmimport is a wasm-only directive that declares a dependency -on an external function provided by a wasm module. It replaces any Go -function calls to the annotated function with a `CALL` instruction to -the wasm function identified by ``importmodule`` and ``importname`` during -compilation. +The //go:wasmimport directive is wasm-only and must be followed by a +function declaration. +It specifies that the function is provided by a wasm module identified +by ``importmodule`` and ``importname``. - //go:wasmimport a_module f - func g() + //go:wasmimport a_module f + func g() The types of parameters and return values to the Go function are translated to Wasm according to the following table: