News for hackers. Stuff that matters.
Re:Buffered Channels in Go: Tips and Tricks by rplnt on Monday January 15, 2018 @09:03AM (#16150522)
> If you do have pointers, or if the item iself [sic] is a pointer, it is up to you to ensure that the pointed-to objects remain valid while it is in the queue and being consumed.

Does this mean the producer have to keep pointer for the queued item around or it could get garbage collected? That seems.. unintuitive? Or is it just that working with the object could make the old pointer invalid?

Re:Buffered Channels in Go: Tips and Tricks by kasey_junk on Monday January 15, 2018 @09:09AM (#16150563)
The latter. The GC won’t collect it while the pointer references it.