Skip to content

Commit d6eda9e

Browse files
Merge pull request #142 from dipankardas011/fix-tinygo-wasip2-docs
patch: for tinygo wasip2 support
2 parents 5c13408 + 784b95e commit d6eda9e

File tree

1 file changed

+5
-5
lines changed
  • component-model/src/language-support

1 file changed

+5
-5
lines changed

component-model/src/language-support/go.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ We now have an add component that satisfies our `example` world, exporting the `
103103
we can confirm using another `wasm-tools` command:
104104

105105
```sh
106-
$ wasm-tools component wit add.component.wit
106+
$ wasm-tools component wit add.component.wasm
107107
package root:component
108108

109109
world root {
@@ -168,7 +168,7 @@ Our new steps use a low-level tool, [`wit-bindgen`](https://github.com/bytecodea
168168
First, install [a release of `wit-bindgen`](https://github.com/bytecodealliance/wit-bindgen/releases), updating the environment variables for your desired version, architecture and OS:
169169

170170
```sh
171-
export VERSION=0.24.0 ARCH=aarch64 OS=macos
171+
export VERSION=0.26.0 ARCH=aarch64 OS=macos
172172
wget https://github.com/bytecodealliance/wit-bindgen/releases/download/v$VERSION/wit-bindgen-$VERSION-$ARCH-$OS.tar.gz
173173
tar -xzf wit-bindgen-$VERSION-$ARCH-$OS.tar.gz
174174
mv wit-bindgen-$VERSION-$ARCH-$OS/wit-bindgen ./
@@ -184,10 +184,10 @@ go mod init example.com
184184

185185
Next, run `wit-bindgen`, specifying TinyGo as the target language, the path to the
186186
[`add.wit`](../../examples/example-host/add.wit) package, the name of the world in that package to
187-
generate bindings for (`example`), and a directory to output the generated code (`gen`):
187+
generate bindings for (`adder`), and a directory to output the generated code (`gen`):
188188

189189
```sh
190-
wit-bindgen tiny-go ./add.wit --world example --out-dir=gen
190+
wit-bindgen tiny-go ./add.wit --world adder --out-dir=gen
191191
```
192192

193193
The `gen` directory now contains several files:
@@ -262,7 +262,7 @@ Once again, we can build our core module using TinyGo, componentize it, and adap
262262
```sh
263263
export COMPONENT_ADAPTER_REACTOR=/path/to/wasi_snapshot_preview1.reactor.wasm
264264
tinygo build -o add.wasm -target=wasi add.go
265-
wasm-tools component embed --world example ./add.wit add.wasm -o add.embed.wasm
265+
wasm-tools component embed --world adder ./add.wit add.wasm -o add.embed.wasm
266266
wasm-tools component new -o add.component.wasm --adapt wasi_snapshot_preview1="$COMPONENT_ADAPTER_REACTOR" add.embed.wasm
267267
```
268268

0 commit comments

Comments
 (0)