I agree with the sentiment that putting these options in context.Context values is inappropriate.
Chris On Friday, December 9, 2016 at 7:14:03 PM UTC-5, Dave Cheney wrote: > > I agree with this. This feels like a case of abusing the "bag of values" > nature of context's Value() feature to smuggle arbitrary and unstructured > data in and out of an interface rather than change the API. > > > On Wednesday, 7 December 2016 00:48:48 UTC+9, Chandra Sekar S wrote: >> >> Documentation of the context package says, >> >> "Use context Values only for request-scoped data that transits processes >> and APIs, not for passing optional parameters to functions." >> >> sql.BeginContext introduced in 1.8, uses Context to receive options like >> IsolationLevel and read-only flag. These are neither request-specific nor >> cross-cutting. They are options that are typically specific to a type of >> operation, but common to all requests. >> >> Isn't this use in db/sql contradicting the recommendation in context's >> doc? >> >> -- >> Chandra Sekar.S >> > -- 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.