You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: component-model/src/language-support/go.md
+11-49Lines changed: 11 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,9 @@ Optional: Install the `wkg` CLI tool to resolve the imports in the WIT file. The
20
20
21
21
## 2. Determine which World the Component will Implement
22
22
23
-
The `wasip2` target of TinyGo assumes that the component is targeting `wasi:cli/command@0.2.0` world so it requires the imports of `wasi:cli/imports@0.2.0`. We need to include them in the `add.wit`. Tools like `wkg` can be handy to build a complete WIT package by resolving the imports.
23
+
The `wasip2` target of TinyGo assumes that the component is targeting `wasi:cli/command@0.2.0` world so it requires the imports of `wasi:cli/imports@0.2.0`. We need to include them in the `add.wit`.
24
+
25
+
Tools like `wkg` can be convenient to build a complete WIT package by resolving the imports.
24
26
25
27
```wit
26
28
# wit/add.wit
@@ -34,55 +36,15 @@ world adder {
34
36
Running the `wkg wit build` command will resolve the imports and generate the complete WIT file encoded as a Wasm component.
35
37
36
38
```console
37
-
wkg wit build
39
+
$ wkg wit build
40
+
WIT package written to docs:adder@0.1.0.wasm
38
41
```
39
42
40
-
Or you can manually include the required imports in the `add.wit` file. Below is the minimal `add.wit` file that includes the required imports:
0 commit comments