Note template
正文連到這篇 0
A buffered channel can hold values before a receiver is ready:
ch := make(chan int, 1)
ch <- 42
fmt.Println(<-ch) // 42
A second send before the receive would block: capacity is one, not unlimited.
A buffered channel can hold values before a receiver is ready:
ch := make(chan int, 1)
ch <- 42
fmt.Println(<-ch) // 42
A second send before the receive would block: capacity is one, not unlimited.