Let me start by saying that Go Channels are GREAT! They are used for communication, allowing sending data between goroutines, and for synchronization, so that one goroutine doesn’t get ahead of another. But, how can a single data structure do all of this? Let’s go behind the scenes of Go Channels

Go Channels
Go Channels

A channel is a data type that provides us for free the following unusual and really interesting characteristics:

  • Communicates values between goroutines in a FIFO manner
  • Blocks and unblocks goroutines
  • Provides an optional buffer

Channels in action

Using channels we convert a sequential and potential slow application into a fast, concurrent…

Steven Rojas

Senior Software Developer, Software architect, Golang enthusiastic.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store