Skip to content

Commit

Permalink
better wording
Browse files Browse the repository at this point in the history
Change-Id: I045ce5dfb4ea28344a387ce0bb18392c6d0d5a9a
  • Loading branch information
mauri870 committed Jan 10, 2024
1 parent ef4a457 commit bf158db
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/cmd/compile/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bf158db

Please sign in to comment.