danieljoos / go-wasm-examples

Some small examples of using Go and WebAssembly
37 stars 8 forks source link

Maybe make the WASM EXEC downloader repsec the golang versions ? #4

Open joe-getcouragenow opened 4 years ago

joe-getcouragenow commented 4 years ago

Here: https://github.com/danieljoos/go-wasm-examples/blob/master/server/wasmExec.go#L9

The latest being: https://raw.githubusercontent.com/golang/go/release-branch.go1.14/misc/wasm/wasm_exec.js

danieljoos commented 4 years ago

Good point. I haven't updated this since 1.12. You have any good idea to solve this, m.b. during build time?

joe-getcouragenow commented 4 years ago

Yeah the fix is easy.

In the GOROOT environment there is the file in question. It's in the "misc folder I think.

So just copy that at compile time

Then it will of course be using the version that the developer has on their machine at compile time.

Seen this approach used before and is very effective I think