Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Commit

Permalink
Remove meaningles callback for cancelled context
Browse files Browse the repository at this point in the history
  • Loading branch information
morigs committed Nov 12, 2021
1 parent 3e4357c commit a284242
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (m *Mock) WithDeadline(parent context.Context, deadline time.Time) (context
dur := m.Until(deadline)
if dur <= 0 {
ctx.cancel(context.DeadlineExceeded) // deadline has already passed
return ctx, func() { ctx.cancel(context.Canceled) }
return ctx, func() {}
}
ctx.Lock()
defer ctx.Unlock()
Expand Down

0 comments on commit a284242

Please sign in to comment.