h2non / gock

HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽
https://pkg.go.dev/github.com/h2non/gock
MIT License
2.04k stars 106 forks source link

Add support for request context expiration and cancellation #85

Closed wfscot closed 3 years ago

wfscot commented 3 years ago

Add support for expired and cancelled contexts, both with and without delay operations. This should make the behavior of gock mocks more similar to actual HTTP upstreams using the standard HTTP client.

Note that this change fundamentally requires go version 1.13 or greater. As such, go.mod was updated accordingly.

Resolves #84

wfscot commented 3 years ago

Closing as this has pull in unintended changes. Will submit new PR.