Summary
In this chapter, we took a look at the design patterns common in object-oriented code, namely the strategy pattern, the decorator pattern, and the Hollywood principle (IoC). We saw that these can be implemented in Go without the need for extensive object taxonomy simply by leveraging functions as first-class citizens. We also discussed the need for design patterns in the functional paradigm and concluded that either the patterns are not needed or can be solved using functions. In terms of real functional code that is reusable for solving common problems, we pointed at concepts such as function currying and function composition. In the next chapter, we will take a look at how functional programming can be leveraged to implement concurrent code.