Go Time: Golang, Software Engineering cover image

So do we like Generics or not?

Go Time: Golang, Software Engineering

00:00

How to Use Constraint Types in a Generic Function

Constraint is actually an interface type. And it can have methods like any interface type. So that means that you're constrained that that type is constrained to have those methods. But also you can name a number of other types and say this interface must be one of these. That's how, for example, that sort function can work with less than because it's got a constraint.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app