IsRecording returns the response recorder and a true value when the response writer is recording the status code, body, headers and so on, else returns nil and false.
()
| 6075 | // when the response writer is recording the status code, body, headers and so on, |
| 6076 | // else returns nil and false. |
| 6077 | func (ctx *Context) IsRecording() (*ResponseRecorder, bool) { |
| 6078 | // NOTE: |
| 6079 | // two return values in order to minimize the if statement: |
| 6080 | // if (Recording) then writer = Recorder() |
| 6081 | // instead we do: recorder,ok = Recording() |
| 6082 | rr, ok := ctx.writer.(*ResponseRecorder) |
| 6083 | return rr, ok |
| 6084 | } |
| 6085 | |
| 6086 | // Exec calls the framewrok's ServeHTTPC |
| 6087 | // based on this context but with a changed method and path |
no outgoing calls
no test coverage detected