What are channels used for?
问题 When looking through some Go code I found the following: ch := make(chan int) I looked up in a online tutorial how Go Channels work: https://tour.golang.org/concurrency/2 But I find this example unclear. Can someone give me a easy explanation and an example of the use of channels? 回答1: chan is a channel in Golang. In simple word you can think it as a box in which you put a item at one end and then pick it from other end. Unbuffered Channels Buffered Channel This is the small code I have