channel关闭以后,再往其发送或接收,会发生什么

题目来源:字节跳动

答案:

给⼀个已经关闭的 channel 发送数据,会引起 pannic; 从⼀个已经关闭的 channel 接收数据,如果缓冲区中为空,则返回⼀个零值