2min chapter

Go Time: Golang, Software Engineering cover image

What's new in Go 1.20

Go Time: Golang, Software Engineering

CHAPTER

How to Convert Slices to Arrays?

If you're not sure if it's going to be long enough, of course, you can just do an if statement and say if length is less than whatever, then don't try to convert it. The three dot trick requires the length to be sort of a constant that the compiler can figure out from context. So it doesn't work when you're converting a slice. It only works for things like when you're doing like a you're typing in a literal array, and then it can figure it out. Oh, John, it's such a good link. I'm just going to celebrate that with a little song about Johnny doing the great link. Are you ready?

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