blob: a7525807b6b2c5366e08b03e4f34d4a133f9151a [file] [log] [blame]
// +build ignore,OMIT
package main
import (
"fmt"
"math/rand"
"time"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
func main() {
a, b := make(chan string), make(chan string)
go func() { a <- "a" }()
go func() { b <- "b" }()
if rand.Intn(2) == 0 {
a = nil // HL
fmt.Println("nil a")
} else {
b = nil // HL
fmt.Println("nil b")
}
select {
case s := <-a:
fmt.Println("got", s)
case s := <-b:
fmt.Println("got", s)
}
}