Go Time: Golang, Software Engineering cover image

Reflection and meta programming

Go Time: Golang, Software Engineering

CHAPTER

The Importance of Testing for Edge Cases

Matt: One of the first issues I had with Reflect was that when somebody passes something in, you're like, okay, I'm going to get the value of this. But then somebody passes in like a nil pointer that has a type, but it's a nil pointer. And all of a sudden your code breaks and you are like, what just happened? You end up with these weird cases where if the type kind is a pointer and if it's nil, then you need to like use reflect dot new to instantiate a new elements. Like there's all these weird cases that you get to where it seems really simple. Matt: At the very end of it, you're still

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner