mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
Iris + WebAssemply = = 💓
Former-commit-id: 44f08f112cfba8006d2a6fe34e32b24e5c246856
This commit is contained in:
15
_examples/webassembly/basic/client/hello_go11beta1.go
Normal file
15
_examples/webassembly/basic/client/hello_go11beta1.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// +build go1.11beta1
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"syscall/js"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// GOARCH=wasm GOOS=js /home/$yourusername/go1.11beta1/bin/go build -o hello.wasm hello_go11beta1.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)
|
||||
}
|
||||
Reference in New Issue
Block a user