Solution Review: Devise Random Bit Generator

This lesson discusses the solution to the challenge given in the previous lesson.

Press + to interact
package main
import (
"fmt"
)
func main() {
ch := make(chan int)
// consumer:
go func() {
for {
fmt.Print(<-ch, " ")
}
}()
// producer:
for i:=0; i<=100000; i++ {
select {
case ch <- 0:
case ch <- 1:
}
}
}

Get hands-on with 1400+ tech skills courses.