golang代码 select channel
-------------------------------------------------------------------------------- 超时 select { case v := <-in: fmt.Println(v) case <-time.After(time.Second): return } -------------------------------------------------------------------------------- 非阻塞 select { case v := <-in: // 尝试接收 fmt.Println(v) default: }

浙公网安备 33010602011771号