Do runs the provided function with a context in which the errors are cleared out and will timeout after 10 seconds.
(ctx context.Context, do func(context.Context))
| 25 | // Do runs the provided function with a context in which the |
| 26 | // errors are cleared out and will timeout after 10 seconds. |
| 27 | func Do(ctx context.Context, do func(context.Context)) { |
| 28 | ctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), 10*time.Second) |
| 29 | do(ctx) |
| 30 | cancel() |
| 31 | } |
no outgoing calls