Anonymous Closure

In this lesson there is a detailed description of how to use closures along with a channel.

Passing anonymous closure through a channel

Functions are values in Go, and so are closures. So, we can construct a channel c, whose data type is a function, as in the following example:

Get hands-on with 1200+ tech skills courses.