Skip to content

Commit

Permalink
Fix Tinygo instructions (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hpmason authored Mar 15, 2023
1 parent 7ab30c4 commit 80d9ffa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ e.g. Java, Kotlin, Clojure, Scala, etc.

Go code can be compiled for the `wasm32-wasi` target using the [TinyGo](https://tinygo.org/) compiler. For example, the following command compiles `main.go` to a wasm modules with WASI support:

`tinygo build -target -target=wasi main.go`
`tinygo build -target=wasi main.go`

> Note: the current TinyGo bindgen only supports TinyGo version v0.27.0 or later.
Expand Down Expand Up @@ -353,9 +353,9 @@ This can then be compiled with `tinygo` and assembled into a component with:

```sh
go generate # generate bindings for Go
tinygo build -target=wasi --out main.wasm my-component.go # compile
wasm-tools component embed --world world ./wit main.wasm > main.embed.wasm # create a component
wasm-tools component new main.embed.wasm -o main.component.wasm
tinygo build -target=wasi -o main.wasm my-component.go # compile
wasm-tools component embed --world host ./wit main.wasm -o main.embed.wasm # create a component
wasm-tools component new main.embed.wasm --adapt wasi_snapshot_preview1.wasm -o main.component.wasm
wasm-tools validate main.component.wasm --features component-model
```

Expand Down

0 comments on commit 80d9ffa

Please sign in to comment.