Created
January 17, 2021 10:32
-
-
Save gocs/5dda9ad0bb909aecf09779a93645637b to your computer and use it in GitHub Desktop.
http: superfluous response.WriteHeader call from
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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