5min chapter

Changelog Master Feed cover image

The bits of Go we avoid (and why) (Go Time #269)

Changelog Master Feed

CHAPTER

How to Use New in Generic Code

The new keyword is the thing that makes things. How can you do without it? Well of course there are other formats like you use the structure name with the curly braces immediately after to instantiate it, usually taking a pointer sometimes at the start of that. And I like that pattern more because even if you're not setting any fields explicitly, it's the same as if you do. But also if it probably comes for me more down to writing maintainable things. It's always about being very explicit and clear so that when I come back later, I don't have to decode anything.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode