I am thinking about adding the capacity to dump the contents of chans to
the utter package[1].

The code to do this is relatively straightforward[2], though it messes
about with unsafe aliasing of runtime types in nasty ways.

One thing that I'm not sure of is the locking that is required (I expect
that the code at [2] is racy since it makes no attempt to lock the chan
struct when it reads). I could copy the lock implementation from the
runtime, but that adds a significant maintenance burden. Previously
(when 6c was still in existence) we could do nasty things to gain access
to symbols across package boundaries which now is done for the compiler
with the //go:linkname directive I think. Presumably it is still
possible though. Can someone point me to how I might do this?

thanks
Dan

[1]https://github.com/kortschak/utter
[2]https://play.golang.org/p/3zKYtVRGxQ

-- 
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.

Reply via email to