select用法 同switch类似,如下: timeout := make (chan bool, 1)ch := make(chan int) select { case <-ch: case <-timeout: fmt.Println("timeout!
確定! 回上一頁