mirror of https://github.com/gin-gonic/gin.git
Replace fmt.Sprintf with direct combining strings
This commit is contained in:
parent
cb2e89b1ca
commit
9be676c638
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue