2021-03-20 17:32:11 +07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2021-03-21 05:08:27 +07:00
|
|
|
"syscall/js"
|
2021-03-20 17:32:11 +07:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-03-21 02:28:47 +07:00
|
|
|
fmt.Println("Hello from go-mod-wasm!")
|
2021-03-21 05:08:27 +07:00
|
|
|
js.Global().Get("__go_wasm__").Set("__ready__", true)
|
2021-03-21 02:28:47 +07:00
|
|
|
|
2021-03-21 05:08:27 +07:00
|
|
|
c := make(chan bool, 0) // in Go Wasm, the program may not exit
|
2021-03-20 17:32:11 +07:00
|
|
|
<-c
|
|
|
|
}
|