Considering that the standard library since 1.7 has a built-in context which net/http, chi and others use or can be layered in with httprouter, and the fact that we already have gorilla/context which is fairly widely used too and a few others what's the benefit of using this one?
Because the addition of context is relatively recent, many people are still using solutions written before it (indeed gorilla/context has a note to say you should probably use the new context on requests) - it will take a while to converge on new solutions. So I still think older code is of interest, and the handler signature is not sacrosanct - if they rewrote net/http now I wouldn't be surprised if they came up with a different signature (just as an example I prefer my handlers to return an error, and also have some legacy code referring to per-request Contexts, which is pretty confusing now we have an official way to do this). I think things can be of interest even if they are not immediately useful, even if only as a learning experience for the poster and other readers.
I would like to keep the tone of responses as positive as possible, because readers are at many levels in their understanding of go and the stdlib (including me), so it's better to point out resources and possibilities rather than challenge people to justify their decisions, which can get a bit personal. Thanks for pointing this poster in the right direction on context though and for your other contributions here recently, which are really welcome.
Thanks for your reply! Actually my bad in this case, I thought this was new, hadn't properly looked at the history. That's why my initial reply might've taken a slightly harsher tone, I didn't understand why we'd need to have yet another one of these. But seeing the history now that makes sense.
Considering that the standard library since 1.7 has a built-in context which net/http, chi and others use or can be layered in with httprouter, and the fact that we already have gorilla/context which is fairly widely used too and a few others what's the benefit of using this one?
Because the addition of context is relatively recent, many people are still using solutions written before it (indeed gorilla/context has a note to say you should probably use the new context on requests) - it will take a while to converge on new solutions. So I still think older code is of interest, and the handler signature is not sacrosanct - if they rewrote net/http now I wouldn't be surprised if they came up with a different signature (just as an example I prefer my handlers to return an error, and also have some legacy code referring to per-request Contexts, which is pretty confusing now we have an official way to do this). I think things can be of interest even if they are not immediately useful, even if only as a learning experience for the poster and other readers.
I would like to keep the tone of responses as positive as possible, because readers are at many levels in their understanding of go and the stdlib (including me), so it's better to point out resources and possibilities rather than challenge people to justify their decisions, which can get a bit personal. Thanks for pointing this poster in the right direction on context though and for your other contributions here recently, which are really welcome.
Thanks for your reply! Actually my bad in this case, I thought this was new, hadn't properly looked at the history. That's why my initial reply might've taken a slightly harsher tone, I didn't understand why we'd need to have yet another one of these. But seeing the history now that makes sense.