A receive expression used in an assignment or initialization of the special form
x, ok = <-ch x, ok := <-ch var x, ok = <-ch var x, ok T = <-chyields an additional untyped boolean result reporting whether the communication succeeded. The value of
okistrueif the value received was delivered by a successful send operation to the channel, orfalseif it is a zero value generated because the channel is closed and empty.