252 c.socket.Close()
253 }()
254
255 for {256 select {
257 case message, ok := <-c.send:
258 if !ok {
Select statements with a single case can be replaced with a simple send or
receive. If you intend to handle the case when no value is received from
the channel, add a default
case to make the select
statement non-blocking.
select {
case x := <-ch:
fmt.Println(x)
}
x := <-ch
fmt.Println(x)