After a limited and somewhat hidden version in Go 1.17, Generics are coming to Go 1.18, in the form of type parameters.
This presentation covers generics and the associated library extensions:
- Hello generics : a quick example to get the feel of Go generics
- 10 000 feet view : how they impact code, and what are the expected changes in future releases
- New notation and packages : new and redefined operators and builtins
- Using generics in practice : how to adapt your code for generics and write generics-using code
- Defining constraints : how to create new custom constraints
- Concluding examples : familiar examples including map Keys() and Values(), filters like Map(), Reduce() and Filter(), and a type-safe Sets implementation
- Going further : more advanced resources from the Go project
To move between slides, use the keyboard left/right keys.
You can also watch the presentation in full screen