You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
798 B
HTML
31 lines
798 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<script src="wasm_exec.js"></script>
|
|
<script>
|
|
function fetchAndInstantiate(url, importObject) {
|
|
return fetch(url).then(response =>
|
|
response.arrayBuffer()
|
|
).then(bytes =>
|
|
WebAssembly.instantiate(bytes, importObject)
|
|
).then(results =>
|
|
results.instance
|
|
);
|
|
}
|
|
|
|
var go = new Go();
|
|
var mod = fetchAndInstantiate("/main.wasm", go.importObject);
|
|
window.onload = function() {
|
|
mod.then(function(instance) {
|
|
go.run(instance);
|
|
|
|
teering(console.log);
|
|
});
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body></body>
|
|
</html>
|