go-wasm/simple/prog/main.go

19 lines
255 B
Go
Raw Normal View History

2019-08-06 16:03:11 +03:00
// +build js,wasm
package main
import (
"fmt"
"syscall/js"
)
func printWasm(v []js.Value) {
fmt.Println("Hello from WASM", v)
}
func main() {
js.Global().Set("printWasm", js.NewCallback(printWasm))
fmt.Println("Done...")
<-make(chan struct{})
}