minor fixes

This commit is contained in:
Qiu Jian
2019-02-11 08:46:06 +08:00
parent ff4709e066
commit 89c2421bf7
5 changed files with 9 additions and 4 deletions
+4 -2
View File
@@ -24,6 +24,7 @@ var (
func init() {
notifyClientWorkerMan = appsrv.NewWorkerManager("NotifyClientWorkerManager", 1, 50, false)
templatesTable = make(map[string]*template.Template)
}
func getTemplateString(topic string, contType string, channel notify.TNotifyChannel) ([]byte, error) {
@@ -59,11 +60,12 @@ func getContent(topic string, contType string, data jsonutils.JSONObject) (strin
if err != nil {
return "", err
}
var buf *strings.Builder
err = tmpl.Execute(buf, data.Interface())
buf := strings.Builder{}
err = tmpl.Execute(&buf, data.Interface())
if err != nil {
return "", err
}
log.Debugf("notify.getContent %s %s %s %s", topic, contType, data, buf.String())
return buf.String(), nil
}