(err error)
| 1068 | } |
| 1069 | |
| 1070 | func isTimeoutError(err error) bool { |
| 1071 | if err == nil { |
| 1072 | return false |
| 1073 | } |
| 1074 | if errors.Is(err, context.DeadlineExceeded) { |
| 1075 | return true |
| 1076 | } |
| 1077 | var netErr net.Error |
| 1078 | return errors.As(err, &netErr) && netErr.Timeout() |
| 1079 | } |
| 1080 | |
| 1081 | func sleepWithContext(ctx context.Context, d time.Duration) { |
| 1082 | if d <= 0 { |
no outgoing calls
no test coverage detected