Last active
August 12, 2020 01:25
-
-
Save cyantarek/d423fb92a2009ea2691e75d55fa0c16a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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