Example code on how to create a WebAssembly code using Go.
To compile, just run the command:
GOOS=js GOARCH=wasm go build -o assets/main.wasm cmd/wasm/main.go
To run:
go run cmd/server/main.go
Open the browser with the address localhost:8000
.
This code was done for the article "How to Write a WebAssembly App in Go"