mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
3962710d3d
Former-commit-id: fe6305deed00e170bf4d39a12c0644fe686e0a24
17 lines
406 B
Go
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)
|
|
}
|