Re: [go-nuts] Question about flow of context

2016-11-26 Thread roger peppe
Conventionally context is passed as the first argument to function and
method calls. I'm not sure what you mean by "inner facet" there.

On 25 Nov 2016 16:58, "Diego Bernardes"  wrote:

> Got one question about the design of some packages using the new 'context'
> in golang. Let's assume we have a webserver, when some request get in, we
> can get the context from request, and this request can trigger several
> packages.
> What is the best way to send this context to the other packages? Pass a
> reference to it? Or pass a inner facet with something like 'WithValue'?
>
> I need to permeate the context to all the functions a web request can
> trigger inside the application, this is used to generate logs, metrics,
> errors, etc...
>
> What is the best aproach to solve this issue?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Question about flow of context

2016-11-25 Thread Diego Bernardes
Got one question about the design of some packages using the new 'context' 
in golang. Let's assume we have a webserver, when some request get in, we 
can get the context from request, and this request can trigger several 
packages.
What is the best way to send this context to the other packages? Pass a 
reference to it? Or pass a inner facet with something like 'WithValue'?

I need to permeate the context to all the functions a web request can 
trigger inside the application, this is used to generate logs, metrics, 
errors, etc...

What is the best aproach to solve this issue?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.