I am trying to do load balancing with a container / ring of channels, and I am having trouble recording them. The ring seems to take the {} interface as the type that causes the problem when I try to write the assigned channel to it.
The error that appears is
prog.go:11: invalid operation: chring.Value <- true (send to non-chan type interface {})
simplified code: http://play.golang.org/p/AJs2MV_UUC
package main //import "fmt" import "container/ring" func main() { chring := ring.New(10) for i:=0;i<10;i++ { ch:=make(chan bool) chring.Value=ch chring.Value <- true //dies here chring = chring.Next() } }
damir source share