ServerGoMain returns the main.go for the server
(appPath string)
| 7 | |
| 8 | // ServerGoMain returns the main.go for the server |
| 9 | func ServerGoMain(appPath string) (string, error) { |
| 10 | b := new(bytes.Buffer) |
| 11 | data := map[string]string{ |
| 12 | "AppPath": appPath, |
| 13 | } |
| 14 | if err := serverGoTemplate.Execute(b, data); err != nil { |
| 15 | return "", err |
| 16 | } |
| 17 | return string(b.Bytes()), nil |
| 18 | |
| 19 | } |
| 20 | |
| 21 | var serverGoTemplate = template.Must(template.New("servergo").Parse(serverGoTemplateStr)) |
| 22 |