3 ms·
FWIW the internal Google style guide says to not pass anything via Context unless you _really_ know what you're doing and why. Things that make sense: security
by cflewis 2y ago
FWIW the internal Google style guide says to not pass anything via Context unless you _really_ know what you're doing and why. Things that make sense: security tokens and tracing. Things that don't make sense: almost everything else.
- throwaway2037 2y ago> internal Google style guide Can we read this somewhere?
- Saser 2y agohttps://google.github.io/styleguide/go/ https://google.github.io/styleguide/go/ is the public version of it. Having read both I'd say the differences are small. The main thing missing, though, are the GoTip episodes that haven't been made public, and which are excellent.
- starquake 2y agoI think the Google Go style guide is really nice and pragmatic. There are some references to the GoTips for some advanced subjects. I hope they release it someday. I made an issue for it: https://github.com/google/styleguide/issues/881 https://github.com/google/styleguide/issues/881
- konart 2y agoI'm not sure about Google style guild but Go's context package docs state: "Use context Values only for request-scoped data that transits processes and APIs, not for passing optional parameters to functions." https://pkg.go.dev/context https://pkg.go.dev/context Using context as a some sort of a mule is an antipattern.
- throwaway2037 2y ago> Using context as a some sort of a mule I never saw the term "mule" used in this way. Very succinct!
- bdangubic 2y agohttps://www.mulesoft.com/platform/soa/mule-esb-open-source-esb https://www.mulesoft.com/platform/soa/mule-esb-open-source-e... :)
- khana 2y ago[dead]