Channel Merging for (Periodic) Func

Channel Merging for (Periodic) Func
Continuing on this hot streak of posts, I figured I’d write up something I’ve wanted to do a post on for quite a while. The idea here is to have a sort of “arterial channel” where we merge some arbitrary number of channels into one singular channel. There’s actually a couple “Just for Func” episodes on this topic that were extremely helpful: justforfunc #26: why are there nil channels in Go? and justforfunc #27: two ways of merging N channels.
Read more →

Channel Smuggling for Fun and Profit

Channel Smuggling for Fun and Profit
Neat snippet for y’all today. I’m calling this snippet “channel smuggling”; I googled this and all that came up was weird stuff. Anyway, the idea here is that suppose you want to pass a piece of data into a channel and have something do some work on it. However, what if you want to block until after all the work on that data is completed? Here’s an example on Go Playground, and here it is replicated below:
Read more →