3min chapter

Go Time: Golang, Software Engineering cover image

What's new in Go 1.20

Go Time: Golang, Software Engineering

CHAPTER

Go Code - The Context Package

The context package, it defines an interface and part of the interface is that you can cancel the context. So what's new in Go 1.20 is now there's context with cancel cause and that will tell you why something was canceled. The main use of the context type in Go is to define deadlines. You can say, I want this request to try to go in the next two seconds. And if it doesn't get done in two seconds, just give up and abort because by then the user will have already pressed back and gone away.

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