binalyze / httpreq

httpreq is an http request library written with golang to make requests easily and handle responses gracefully.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add context to request.

yakuter opened this issue · comments

We need context.Context to interrupt request. To do this, we should create new request like New(ctx, address). Then we shoud create request with this context.

Hi @yakuter. I'd like to take this issue. Can you assign to me?

Great thank you @gozeloglu

Do I need to add a new parameter to

func New(address string) *Req {
function? If I do that, this change will break the tests in request_test.go. Of course, I can change the all test functions. I just want to be sure about that.

Yes we need to add ctx as first parameter. This is an important change, so we should change our tests too.