On Sun, Oct 2, 2022, 4:46 PM Sven Anderson <s...@redhat.com> wrote:

> Ian Lance Taylor <i...@golang.org> schrieb am Sa. 1. Okt. 2022 um 17:12:
>
>>
>> Another example of goroutine-local storage that we currently support
>> is runtime/pprof.Do, which adds labels to the current goroutine.  This
>> seems OK as the labels are readonly and are inherited by goroutines
>> started with a go statement.  The labels are recorded in profiles.
>
>
> Aren’t they rather write-only? It would be great, if they are
> write-once-read-many, so that you can legally use them in logs and debug
> output at any place.
>

True, write only is a better description.

Ian



I think it would be great to allow storing immutable context.Context for
> such cases.
>
> As it happens, I wrote a small package, that does that „almost“ legally:
> https://pkg.go.dev/github.com/ansiwen/gctx
>
> Cheers
>
> Sven
>
>
>
>

-- 
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/CAOyqgcWf%3D4Kc8HmjmWDOiM56opNJFPmKcsNK%2BehWWHOJrtLqRQ%40mail.gmail.com.

Reply via email to