摘要:
func main() { messageCh := make(chan int, 10) disconnectCh := make(chan struct{}, 1) for i := 0; i < 10; i++ { messageCh <- i } go func() { for { sele
阅读全文
摘要:
func main() { ctx, cancel := context.WithTimeout(context.Background(), 5 * time.Second) defer cancel() go f1(ctx) for i := 0; i < 10; i++ { select { c
阅读全文