Skip to content

Instantly share code, notes, and snippets.

@Israel-Miles
Last active October 26, 2020 00:07
Show Gist options
  • Save Israel-Miles/df7a82c035d759a6a6ff0d6906f0572c to your computer and use it in GitHub Desktop.
Save Israel-Miles/df7a82c035d759a6a6ff0d6906f0572c to your computer and use it in GitHub Desktop.
webassembly index page
<html>
<head>
<meta charset="utf-8"/>
<title>WebAssembly with Go</title>
<body>
<h1>You've compiled Go for WebAssembly, Congratulations!</h1>
<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>
</body>
</head>
<body></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment