Replace fmt.Sprintf with direct combining strings

This commit is contained in:
mstmdev 2022-03-25 22:03:07 +08:00
parent cb2e89b1ca
commit 9be676c638
1 changed files with 1 additions and 3 deletions

View File

@ -129,9 +129,7 @@ func (r JsonpJSON) Render(w http.ResponseWriter) (err error) {
_, err = w.Write(ret)
return err
}
jsonpData := fmt.Sprintf("%s(%s);", template.JSEscapeString(r.Callback), bytesconv.BytesToString(ret))
_, err = w.Write(bytesconv.StringToBytes(jsonpData))
_, err = w.Write(bytesconv.StringToBytes(template.JSEscapeString(r.Callback) + "(" + bytesconv.BytesToString(ret) + ");"))
return err
}