(h context.Handler)
| 69 | } |
| 70 | |
| 71 | func (e ExecutionOptions) buildHandler(h context.Handler) context.Handler { |
| 72 | if !e.Force { |
| 73 | return h |
| 74 | } |
| 75 | |
| 76 | return func(ctx *context.Context) { |
| 77 | // Proceed will fire the handler and return false here if it doesn't contain a `ctx.Next()`, |
| 78 | // so we add the `ctx.Next()` wherever is necessary in order to eliminate any dev's misuse. |
| 79 | // |
| 80 | // 26 Feb 2022: check if manually stopped, and if it's then don't call ctx.Next. |
| 81 | if hasStopped, hasNext := ctx.ProceedAndReportIfStopped(h); !hasStopped && !hasNext { |
| 82 | // `ctx.Next()` always checks for `ctx.IsStopped()` and handler(s) positions by-design. |
| 83 | ctx.Next() |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func (e ExecutionOptions) apply(handlers *context.Handlers) bool { |
| 89 | if !e.Force { |
no test coverage detected