mirror of
https://github.com/kataras/iris.git
synced 2025-01-24 19:21:03 +01:00
f365be3c62
Former-commit-id: 399db6aac44d3b336648d6d61842f4d7a0266842
17 lines
410 B
Go
17 lines
410 B
Go
// +build go1.11
|
|
|
|
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)
|
|
}
|