Go Channels
Go is my favorite language, without a doubt! Readable, simple code, active and friendly community, fast and modern language with GC, and a PERFECT vendoring system (absolutely love it). I realized that the channel mechanics in Go are not completely clear for some people, so let me explain!
Basically, everything is really simple. We have goroutines—it’s like coroutines, but go-routines, did you catch it? :) So we have independent threads using this. Channels are just a mechanism for communication between different goroutines in our program. It’s not limited to use with parallel goroutines, but, to be honest, it’s pointless to use channels outside of goroutines.
评论
?
参与讨论