Package chanbus is a 1:n channel broadcasting for golang.
go get github.com/go-laeo/chanbus
// First 0 means no buffer of main channel, and second
// 0 means blocking on forwarding to derived channels.
ch := chanbus.New(1, 0)
// Send value to main channel.
ch.Send("say, hi")
// Derives new readonly channel
nch := ch.Derive(1)
for v := range nch {
fmt.Println(v) // say, hi
}
The MIT license.