(w http.ResponseWriter, r *http.Request)
| 10 | type Handler func(w http.ResponseWriter, r *http.Request) error |
| 11 | |
| 12 | func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 13 | if err := h(w, r); err != nil { |
| 14 | // handle returned error here. |
| 15 | w.WriteHeader(503) |
| 16 | w.Write([]byte("bad")) |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | func main() { |
| 21 | r := chi.NewRouter() |
no test coverage detected