[go-nuts] Detachable context.Context?

2022-09-03 Thread Alex Besogonov
Hi! Let me give you some context. context.Context in Go serves two main purposes: 1. Cancellation and timeout support. 2. A carrier of values, as a de-facto replacement for thread-local variables. I have a problem with the first item. Cancellation and timeouts automatically propagate to child

Re: [go-nuts] Detachable context.Context?

2022-09-03 Thread 'Sean Liao' via golang-nuts
https://go.dev/issue/40221 - sean On Sat, Sep 3, 2022, 16:56 Alex Besogonov wrote: > Hi! > > Let me give you some context. context.Context in Go serves two main > purposes: > 1. Cancellation and timeout support. > 2. A carrier of values, as a de-facto replacement for thread-local > variables.

Re: [go-nuts] Generics type interference on "T | []T" to get T?

2022-09-03 Thread Jan
If you don't mind me extending the topic a bit: I bumped into a similar issue, which I described here: https://stackoverflow.com/questions/73591149/generics-type-inference-when-cascaded-calls-of-generic-functions One of the solutions for the original question would be to use something like: