Skip to content
New issue

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

net/http: replace a statement in http.Error #71959

Closed
Guest-615695028 opened this issue Feb 26, 2025 · 1 comment
Closed

net/http: replace a statement in http.Error #71959

Guest-615695028 opened this issue Feb 26, 2025 · 1 comment

Comments

@Guest-615695028
Copy link

In the Go function

func Error(w ResponseWriter, error string, code int)

, we can replace

fmt.Fprintln(w, error)

with

w.Write([]byte(error+"\n"))

to reduce stack occupation and improve speed.

@seankhliao
Copy link
Member

unless there's a real world benchmark that shows an improvement, this would just be code churn

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants