© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. FreemanPro Gohttps://doi.org/10.1007/978-1-4842-7355-5_13

13. Type and Interface Composition

Adam Freeman1  
(1)
London, UK
 
In this chapter, I explain how types are combined to create new features. Go doesn’t use inheritance, which you may be familiar with in other languages and instead relies on an approach known as composition. This can be difficult to understand, so this chapter describes some features covered in earlier chapters to set a solid foundation on which to explain the composition process. Table 13-1 puts type and interface composition in context.
Table 13-1

Putting Type and Interface Composition in Context

Question

Answer

What is it?

Composition ...

Get Pro Go: The Complete Guide to Programming Reliable and Efficient Software Using Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.