Skip to content

Instantly share code, notes, and snippets.

@cyantarek
Last active August 12, 2020 01:25
Show Gist options
  • Save cyantarek/d423fb92a2009ea2691e75d55fa0c16a to your computer and use it in GitHub Desktop.
Save cyantarek/d423fb92a2009ea2691e75d55fa0c16a to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"syscall/js"
)
func welcome(this js.Value, args []js.Value) interface{} {
return fmt.Sprintf("Hi and Welcome %s", args[0].String())
}
func main() {
welcomeFunc := js.FuncOf(welcome)
js.Global().Set("welcome", welcomeFunc)
defer welcomeFunc.Release()
fmt.Println("Go WASM Initialized")
select {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment