The race detector should report a race when one goroutine is reading the length of a channel and another is reading or writing to the channel.
func main() {
res := make(chan int, 1)
ch := make(chan bool, 1)
go func() { ch <- true }()
go func() { res <- len(ch) }()
fmt.Println(<-res)
}
@dvyukov