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)
|
_, err = w.Write(ret)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_, err = w.Write(bytesconv.StringToBytes(template.JSEscapeString(r.Callback) + "(" + bytesconv.BytesToString(ret) + ");"))
|
||||||
jsonpData := fmt.Sprintf("%s(%s);", template.JSEscapeString(r.Callback), bytesconv.BytesToString(ret))
|
|
||||||
_, err = w.Write(bytesconv.StringToBytes(jsonpData))
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue