File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -295,5 +295,27 @@ The declaration of lower.f may also have a linkname directive with a
295
295
single argument, f. This is optional, but helps alert the reader that
296
296
the function is accessed from outside the package.
297
297
298
+ //go:wasmimport importmodule importname
299
+
300
+ The //go:wasmimport directive is wasm-only and must be followed by a
301
+ function declaration.
302
+ It specifies that the function is provided by a wasm module identified
303
+ by ``importmodule`` and ``importname``.
304
+
305
+ //go:wasmimport a_module f
306
+ func g()
307
+
308
+ The types of parameters and return values to the Go function are translated to
309
+ Wasm according to the following table:
310
+
311
+ Go types Wasm types
312
+ int32, uint32 i32
313
+ int64, uint64 i64
314
+ float32 f32
315
+ float64 f64
316
+ unsafe.Pointer i32
317
+
318
+ Any other parameter types are disallowed by the compiler.
319
+
298
320
*/
299
321
package main
You can’t perform that action at this time.
0 commit comments