wa-lang.org/wazero@v1.0.2/imports/go/example/README.md (about)

     1  ## gojs example
     2  
     3  This shows how to use Wasm built by go using `GOARCH=wasm GOOS=js`. Notably,
     4  this shows an interesting feature this supports, HTTP client requests.
     5  
     6  ```bash
     7  $ cd stars
     8  $ GOARCH=wasm GOOS=js GOWASM=satconv,signext go build -o main.wasm .
     9  $ cd ..
    10  $ go run stars.go
    11  wazero has 9999999 stars. Does that include you?
    12  ```
    13  
    14  Internally, this uses [gojs](../gojs.go), which implements the custom host
    15  functions required by Go.
    16  
    17  Notes:
    18  * `GOARCH=wasm GOOS=js` is experimental as is wazero's support of it. For
    19    details, see https://wazero.io/languages/go/.
    20  * `GOWASM=satconv,signext` enables features in WebAssembly Core Specification
    21    2.0.