Hi,

I'm struggling to understand what's the point of doing the below

...
handler = &logHandler{log: log, next: handler} // add logging
handler = ensureSessionID(handler)             // add session ID
handler = &ochttp.Handler{                     // add opencensus 
instrumentation
...

Isn't the logHandler struct pointer just thrown away in the next line and 
so on? If the expressions are evaluated just for their effects and value is 
to be discarded why just not assign it in the first place? 

https://github.com/GoogleCloudPlatform/microservices-demo/blob/ccff406cdcd3e043b432fe99b4038d1b4699c702/src/frontend/main.go#L147

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/9b6e7571-9325-4a8d-8f22-78a37f0f9bf4%40googlegroups.com.

Reply via email to