Freedom is nothing without constraints, and Go’s generics gives us a powerful way to build polymorphic types and functions constrained by type sets. Let’s geek out.
All tagged generics
Freedom is nothing without constraints, and Go’s generics gives us a powerful way to build polymorphic types and functions constrained by type sets. Let’s geek out.
Golang generics open up a lot of exciting new possibilities for us as programmers. In this tutorial, we’ll look at ways we can use type parameters to define customised generic types.
Thanks to generics, there are some interesting new ways to program in Go. This article explains how we can use functional programming techniques like Map, Filter, and Reduce, and what kind of problems they might help us to solve.
Now that generics have come to Go, let's take a look at the new syntax for type parameters. We’ll find out why we need type parameters, how we write them, and how we can use them to create generic functions in Go.
Generics what now? This friendly, down-to-earth tutorial series explains how Go’s generic functions and types work, why we need them, and where we can use them.
To celebrate the first anniversary of generics in Go, let’s build something practical and useful: a generic Set type, and add some neat methods to it. Ready for fun?
I spend a lot of time working with students to help them write clearer, better, and more useful Go programs, using a fairly small set of general principles, and here they are. The first is “be boring”, and I’ve tried to follow that advice.