Introduction
Writing flexible, reusable and modular code is vital for developing versatile programs. Working this way ensures that the code is more maintainable, thus avoiding the need to
in
redo the same change in multiple places.
Developments can achieve these design goals through composition. Composition is a way of combining objects or data types in a more complex environment.
,
Go provides this through interfaces, which defines a series of behaviors that a type must comply with. We'll see more about that below.