(withError bool)
| 127 | } |
| 128 | |
| 129 | func InvokeHandler(withError bool) func(w http.ResponseWriter, r *http.Request) { |
| 130 | if withError { |
| 131 | return func(w http.ResponseWriter, r *http.Request) { |
| 132 | w.WriteHeader(http.StatusInternalServerError) |
| 133 | w.Write([]byte("oops")) |
| 134 | } |
| 135 | } |
| 136 | return func(w http.ResponseWriter, r *http.Request) { |
| 137 | w.WriteHeader(http.StatusOK) |
| 138 | w.Write([]byte("hello world")) |
| 139 | } |
| 140 | } |
no test coverage detected