Skip to content

Instantly share code, notes, and snippets.

@gocs
Created January 17, 2021 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gocs/5dda9ad0bb909aecf09779a93645637b to your computer and use it in GitHub Desktop.
Save gocs/5dda9ad0bb909aecf09779a93645637b to your computer and use it in GitHub Desktop.
http: superfluous response.WriteHeader call from
func Error(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
// w.Write's order must be written after you set the w.Writeheader
w.Write([]byte("error message"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment