Fix dependency linting

This commit is contained in:
Markus Thömmes
2020-10-19 11:33:30 +02:00
parent e1fd0bd0eb
commit 34b9d11505
50 changed files with 197 additions and 59 deletions

View File

@@ -131,7 +131,13 @@ func (c *Sender) Do(r *http.Request) (resp *http.Response, err error) {
} else {
err = c.responses[0].e
}
time.Sleep(c.responses[0].d)
select {
case <-time.After(c.responses[0].d):
// do nothing
case <-r.Context().Done():
err = r.Context().Err()
return
}
c.repeatResponse[0]--
if c.repeatResponse[0] == 0 {
c.responses = c.responses[1:]