mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
reorganization of _examples and add some new examples such as iris+groupcache+mysql+docker
Former-commit-id: ed635ee95de7160cde11eaabc0c1dcb0e460a620
This commit is contained in:
16
_examples/webassembly/client/hello_go114.go
Normal file
16
_examples/webassembly/client/hello_go114.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// +build js
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"syscall/js"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// GOARCH=wasm GOOS=js /home/$yourusername/go1.14/bin/go build -o hello.wasm hello_go114.go
|
||||
js.Global().Get("console").Call("log", "Hello Webassembly!")
|
||||
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