example

command module
v0.0.0-...-8dc2976 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 4 Imported by: 0

README

Example for webmididrv

Build the main.wasm file with

GOOS=js GOARCH=wasm go build -o main.wasm main_js.go

Start the webserver with

go run main.go

And then point your browser to http://localhost:8080.

If you need a fresh wasm_exec.js, you can get it with

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

If you create your own html file, make sure, it contains the lines

<script src="wasm_exec.js"></script>
<script>
    const go = new Go();
    WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
        go.run(result.instance);
    });
</script>

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