package main

import "fmt"

func main() {
	var a bool
	var c = make(chan bool, 1)

	c <- false
	a, a = <-c
	fmt.Printf("%t\n", a)

	fmt.Printf("---\n")

	c <- false
	a, a = recv(c)
	fmt.Printf("%t\n", a)
}

func recv(c chan bool) (bool, bool) {
	v, ok := <-c
	return v, ok
}
