mirror of
https://github.com/kataras/iris.git
synced 2025-01-26 03:56:34 +01:00
5d9ded37c4
Former-commit-id: dc6580f072d076b8cb204a681e45905210981153
17 lines
424 B
Go
17 lines
424 B
Go
// +build go1.11beta2
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"syscall/js"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
// GOARCH=wasm GOOS=js /home/$yourusername/go1.11beta1/bin/go build -o hello.wasm hello_go11beta2.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)
|
|
}
|