Added golines playground
All checks were successful
/ publish (push) Successful in 2m43s

This commit is contained in:
Leon Mika 2026-09-06 09:23:55 +10:00
parent 09fceca2f9
commit 40e5379eb3
11 changed files with 250 additions and 2 deletions

12
site/golines/main.js Normal file
View file

@ -0,0 +1,12 @@
try {
await import("/wasm/wasm_exec.js");
const go = new Go();
const response = await fetch("/wasm/golines.wasm");
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await WebAssembly.instantiate(await response.arrayBuffer(), go.importObject);
await go.run(result.instance);
} catch (error) {
document.getElementById("message").textContent = `Unable to load the formatter: ${error.message}. Please reload to try again.`;
document.getElementById("source").disabled = true;
document.getElementById("max-len").disabled = true;
}