Closed locona closed 6 years ago
Hello @locona
When you working in production, context
maybe useful. Let say in your usecase, there so many concurent / go routine running. You can use context to handle the cancelation, timeout or just passing value.
As quoted from this blog post: https://blog.golang.org/context
At Google, we require that Go programmers pass a Context parameter as the
first argument to every function on the call path between incoming and outgoing requests.
This allows Go code developed by many different teams to interoperate well.
It provides simple control over timeouts and cancelation and ensures that
critical values like security credentials transit Go programs properly.
In google, they required the Context parameter as the first argument. So in larger projects, that may have so many programmer in one projects, every programmer will able to use the context based on their needs.
Thank you! I will follow this also in my project!
Hi!
I am composing it with reference to this repository in my project and I am very grateful!
Why did you pass context to all layers with the following changes? feat: add context #9