(timer *time.Timer)
| 1559 | } |
| 1560 | |
| 1561 | func stopTimer(timer *time.Timer) { |
| 1562 | if timer == nil { |
| 1563 | return |
| 1564 | } |
| 1565 | if !timer.Stop() { |
| 1566 | select { |
| 1567 | case <-timer.C: |
| 1568 | default: |
| 1569 | } |
| 1570 | } |
| 1571 | } |
| 1572 | |
| 1573 | func isContextDone(err error) bool { |
| 1574 | return errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) |