Type assertion vs type switches in Go

Despite moonlighting as a gopher for a while, the syntax for type assertion and type switches still trips me up every time I need to go for one of them. So, to avoid digging through the docs or crafting stodgy LLM prompts multiple times, I decided to jot this down in a Go by Exam...

Type assertion vs type switches in Go

Master Go type assertions with i.(T) syntax and type switches. Extract concrete types from interfaces safely with ok idiom examples.

Go 1.22 Release Candidate 2

#​493 — January 30, 2024 Unsub  |  Web Version Go Weekly The Latest Go Developer Survey is Now Open — 2024’s first official Go Developer Survey is out (you can take it here) and the Go team is ready for your feedback. It closes o...

What’s New in Go 1.22: slices.Concat

We’re up to the second release candidate for Go 1.22, which should be released quite soon. In my last blog post, I wrote about my work on reflect.TypeFor for Go 1.22. This time, I’ll be writing about how I proposed and implemented slices.Concat. Here is the signature for sli...

Cryptography in Go: AES explained

AES is the modern standard encryption algorithm, but how does it work? Where does it come from? Let’s kick the tyres with a high-level overview of AES internals.

Cryptography in Go: AES explained

AES is the modern standard encryption algorithm, but how does it work? Where does it come from? Let’s kick the tyres with a high-level overview of AES internals.

In Go, I'm going to avoid using '<code>any</code>' as an actual type

Share your feedback about developing with Go

Help shape the future of Go by sharing your thoughts via the Go Developer Survey

Russ Cox on Go changes

#​492 — January 23, 2024 Unsub  |  Web Version Go Weekly Rust vs Go in 2024? — A perennially popular post from yesteryear has been tweaked for 2024 (though the pros and cons remain quite similar) with a comparison of the ‘both aw...

Omitting dev dependencies in Go binaries

As of now, unlike Python or NodeJS, Go doesn&rsquo;t allow you to specify your development dependencies separately from those of the application. However, I like to specify the dev dependencies explicitly for better reproducibility. While working on a new CLI tool1 for checking d...