Skip to content

Commit

Permalink
Use routine.Go for routine.Release
Browse files Browse the repository at this point in the history
  • Loading branch information
sergerad committed Apr 1, 2024
1 parent 7816357 commit fcd396e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions routine.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ func (r *Routine) Wait() error {
// Release will call the handler against an error returned by this routine.
// Once a routine is released, waiting on it will return nil.
func (r *Routine) Release(handler func(error)) {
go func() {
Go(func() error {
handler(r.Wait())
}()
return nil
})
}

// Go launches a goroutine that will return an error if the provided func panics or
Expand Down

0 comments on commit fcd396e

Please sign in to comment.