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

Detect superfluous response.WriteHeader calls #853

Open
breml opened this issue May 7, 2019 · 1 comment
Open

Detect superfluous response.WriteHeader calls #853

breml opened this issue May 7, 2019 · 1 comment

Comments

@breml
Copy link
Contributor

breml commented May 7, 2019

Multiple calls to response.WriteHeader (package net/http) are superfluous.

Examples:

w.WriteHeader(http.StatusOK)
if _, err := w.Write([]byte("ok")); err != nil {
	w.WriteHeader(http.StatusInternalServerError)
}

The second call to WriteHeader will issue a log line in net/http.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants