ClientGoMain returns the Go code for the main function for the wasm app
(appPath string)
| 7 | |
| 8 | // ClientGoMain returns the Go code for the main function for the wasm app |
| 9 | func ClientGoMain(appPath string) (string, error) { |
| 10 | b := new(bytes.Buffer) |
| 11 | data := map[string]string{"AppPath": appPath} |
| 12 | if err := clMainTemplate.Execute(b, data); err != nil { |
| 13 | return "", err |
| 14 | } |
| 15 | return string(b.Bytes()), nil |
| 16 | } |
| 17 | |
| 18 | var clMainTemplate = template.Must(template.New("cl").Parse(clMainTemplateStr)) |
| 19 |