4
Go Generics
This chapter is about generics and how to use the new syntax to write generic functions and define generic data types. Generic programming is a programming paradigm that allows the developer to implement a function using one or more data types that are going to be provided at a later time.
The Go generics support came with Go 1.18, which was officially released in February 2022. As a result, Go generics is now old news! Nevertheless, the Go community is still trying to make sense and good use of generics. In fact, most Go developers are already doing their job without the help of generics.
If you feel that this chapter does not interest you at this point of your learning journey, feel free to skip it and come back at a later stage. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access