Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
by runner.mei:
func JSEscape(dst io.Writer, src []byte) func JSEscapeString(dst io.Writer, src string)
The text was updated successfully, but these errors were encountered:
Comment 1:
What would the functions do?
Sorry, something went wrong.
Comment 2:
More importantly, what would they do that json.Marshal does not?
Comment 3 by runner.mei:
This is in the interests of efficiency, the scene is as follows: buffer.WriteString(`{"a":"`) JSEscapeString(buffer,`aa"a`) buffer.WriteString(`", "b":"`) JSEscapeString(buffer,`aa"a`) buffer.WriteString(`"}`)
Comment 4:
You can use json.Marshal instead of JSEscapeString here.
Status changed to WorkingAsIntended.
Comment 5 by runner.mei:
yes,it is ok, but it is slower with unnecessary memory copy
No branches or pull requests
by runner.mei:
The text was updated successfully, but these errors were encountered: