• A go program can be compiled to wasm to run in a browser environment by using the following options
    • GOOS=js
    • GOARCH=wasm
GOOS=js GOARCH=wasm go build main.go -o main.wasm
  • This program is now ready to be run in a browser environment.
  • The glue code is shipped with the go toolchain and can be found at $(GOROOT)/misc/wasm/wasm_exec.js