Skip to content

Commit

Permalink
collect errors from condition in defer
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo authored and dolmen committed Oct 13, 2023
1 parent 4ed68e1 commit 8992013
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1930,8 +1930,10 @@ func EventuallyWithT(t TestingT, condition func(collect *CollectT), waitFor time
tick = nil
go func() {
collect := new(CollectT)
defer func() {
ch <- collect.errors
}()
condition(collect)
ch <- collect.errors
}()
case errs := <-ch:
if len(errs) == 0 {
Expand Down

0 comments on commit 8992013

Please sign in to comment.