Syncronization

We can make use of channels if we want to synchronize goroutines. When synchronizing we want to make the goroutines work in a defined way, for example not starting the next goroutine until the previous one has finalized its execution.

Channels help to do this as they can be used to block the process and then can also be used to notify the second goroutine that the previous one has finished its work .

Let's consider a very basic example of channel synchronization, where we'll see how we can do this with the help of a buffered channel.

channel_syncronization.go