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 context expiration cancellation support #86

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

h2non commented 3 years ago

Thanks! Would you mind fixing the formatting issue?

https://travis-ci.org/github/h2non/gock/jobs/772774065#L283-L322

wfscot commented 3 years ago

Done. Sorry about that. Let me know if you need anything else.