Skip to content

Commit

Permalink
Add MustRegister func
Browse files Browse the repository at this point in the history
  • Loading branch information
revenkroz committed May 18, 2024
1 parent 5ec29e8 commit 19ab130
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 19ab130

Please sign in to comment.