Updated WebAssembly (markdown)

Hajime Hoshi 2018-07-06 03:57:35 +09:00
parent 12ca64f36b
commit ff4f99593e

@ -5,14 +5,18 @@ As there are differences between the latest Go and Go 1.11 beta, I recommend to
1. Checkout the latest Go (https://go.googlesource.com/go) 1. Checkout the latest Go (https://go.googlesource.com/go)
2. Compile the compiler by running `./make.bash` 2. Compile the compiler by running `./make.bash`
After that, use the compiled `go` binary.
# Compile your game # Compile your game
```sh ```sh
GOOS=js GOARCH=wasm /path/to/latest/gocode/bin/go build -o yourgame.wasm github.com/yourname/yourgame GOOS=js GOARCH=wasm /path/to/latest/gocode/bin/go build -o yourgame.wasm github.com/yourname/yourgame
``` ```
# Copy `wasm_exec.js` to execute the Wasm binary
```sh
cp /path/to/latest/gocode/bin/go/misc/wasm_exec.js .
```
# Create an HTML # Create an HTML
```html ```html