Compile Go to JS in the browser (using GopherJS)
npm install @live-codes/go2jshtml
`
ESM:
`js
import { compile, format } from 'https://cdn.jsdelivr.net/npm/@live-codes/go2js';
const code =
;
format(code)
.then((formatted) => {
console.log(formatted);
// return compile(formatted, 'https://cdn.jsdelivr.net/npm/@live-codes/go2js/build/');
return compile(formatted);
})
.then(eval)
.catch(console.warn);
`
Run npm start` to start a server (http://127.0.0.1:8080) and watch for changes.