I have a HandleFunc
, which in case of success, I want (apparently) to be able to
- sent a
200
response - write an informative message in the response
However the following snippet (executed in the happy path)
if fullRun {
w.Write([]byte(successMsg))
w.WriteHeader(http.StatusOK)
}
is causing this message in my application logs
http: superfluous response.WriteHeader
why is that?
Is there another pattern/practice to be followed when trying to both return 200
as also a (text) message?