Go Time: Golang, Software Engineering cover image

What's new in Go 1.20

Go Time: Golang, Software Engineering

00:00

What's the Deal With Comparative Types in Go?

In the Go spec, there's this idea of comparable types and then types that are not comparable. A comparable type is like if you have two strings, you can say string X equals string Y or string X does not equal string Y. There are things that are not similar in Go such as slices being different areas in memory. You're just not allowed to compare slices to each other. That's the only legal comparison you can make. And so for interface types, this gets a little bit weird. If you want to say X equal to Y and X and Y are both some interface type, you can do that even if the concrete type underneath the interface is something that wouldn't normally be

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