package main

func main() {
	// section: closed
	c1 := make(chan int)
	close(c1)
	c1 <- 1 // panic: send on a closed channel
	// section: closed

	// section: double
	c2 := make(chan int)
	close(c2)
	close(c2) // panic: closeing a channel that is already closed
	// section: double

	// section: send
	var c3 chan int
	c3 <- 1 // panic: send on a nil channel
	// section: send

	// section: read
	var c4 chan bool
	<-c4 // panic: read from a nil channel: all goroutines are asleep
	// section: read

}
