June 2017
Intermediate to advanced
400 pages
10h 32m
English
Closures in Go are very powerful. Although our collections functions are not generic, they're relatively small and easily applied with a variety of functions to our WorkWith struct. You may notice from looking at this that we're not returning errors anywhere. The idea of these functions are that they're pure. There are no side effects to the original list, except that we choose to write over it after each call.
If you need to apply layers of modification to a list or struct of lists, this pattern can save you a lot of confusion and makes testing very straightforward. It is also possible to chain maps and filters together for a very expressive coding style.
Read now
Unlock full access