iris/_examples/webassembly/basic/client/hello_go111.go
Gerasimos (Makis) Maropoulos 3962710d3d Version 11 released. Read https://github.com/kataras/iris/blob/master/HISTORY.md#su-21-october-2018--v1100
Former-commit-id: fe6305deed00e170bf4d39a12c0644fe686e0a24
2018-10-21 19:20:05 +03:00

17 lines
406 B
Go

// +build js
package main
import (
"fmt"
"syscall/js"
"time"
)
func main() {
// GOARCH=wasm GOOS=js /home/$yourusername/go1.11/bin/go build -o hello.wasm hello_go111.go
js.Global().Get("console").Call("log", "Hello WebAssemply!")
message := fmt.Sprintf("Hello, the current time is: %s", time.Now().String())
js.Global().Get("document").Call("getElementById", "hello").Set("innerText", message)
}