diff --git a/runner/runner.go b/runner/runner.go index 5d98780..e8cfc82 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -31,6 +31,12 @@ func (r *Runner) Use(opts ...Option) { } } +func (r *Runner) MustRegister(handler CommandHandler) { + if err := r.Register(handler); err != nil { + panic(err) + } +} + func (r *Runner) Register(handler CommandHandler) error { r.lock.Lock() defer r.lock.Unlock()