go-wasm

command module
v0.0.0-...-5727782 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2019 License: MIT Imports: 3 Imported by: 0

README

Go WASM

Trying out Go web assembly. Go wiki reference.

Build

Copy required file from GOROOT if not provided.

cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

Build the wasm code.

GOOS=js GOARCH=wasm go build -o lib.wasm

Start a web server (i.e. with goexdec) to get CORS and WASM download to work.

goexec 'http.ListenAndServe(":8080", http.FileServer(http.Dir(".")))'

If there are no blocking features file can be tested with node without a browser.

GOOS=js GOARCH=wasm go run -exec="$(go env GOROOT)/misc/wasm/go_js_wasm_exec" .

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL