Hacker News new | ask | show | jobs
by tptacek 1417 days ago
`http.Error` is a convenience for writing an error message and setting the code. You can just use `w.Write` if you want. The reason `Error` isn't part of the interface signature for `ResponseWriter` is presumably that everything that implements `ResponseWriter` would have to duplicate the logic.

Either way, it wouldn't address the bug here.