Browse all publicly available articles on willem.dev
How to handle and send "cancellation signals" using the context package in the standard library.
Some guidance on choosing the right constructor for your context (and one thing you should never do).
Not every value should be stored in a Go context, this article examines why.
Don't litter your code base with keys and/or type assertions. Add and get values from contexts in a type safe way.
This article shows how to implement URL path parameters using the routing pattern wildcards introduced in Go 1.22.
If you're not yet comfortable with Go's type system and/or interfaces it can be a surprisingly difficult thing to wrap your head around. Read this post to learn how it works.
An introduction to arrays, slices and their relationship. Get a solid mental model by implementing your own slice.
Append and copy are commonly used functions, but they can have some surprising behavior. This article helps you build a good intuition by showing you how to implement them yourself.
So far we have only created slices by slicing arrays, but there are more convenient ways to create new slices. In this article we will look at make, literals and re-slicing.
What is the difference between a slice of pointers and a slice of values? And when should you use one or the other? This article explains.
What is the point of using pointers to slices? This article discusses when it's a good idea to use pointers to slices.
This article explains anonymous structs for people who are unfamiliar with them.
Are your tests growing out of control? This article explains how to deal with large structs in tests.
Learn how to think about time in Go. This article shows you how both types work together to represent moments in time.
Learn how Go measures time without stumbling on leap seconds, daylight saving time or timezone changes.
Why isn't comparing times or dates as easy as comparing numbers? Find out in this article.
Learn how to change the default JSON format of time.Time values in Go.
Frustrated by time.Parse? You're not alone. This article will get you unstuck and moving again.
Gain access to more content and get notified of the latest articles:
I send emails every 1-2 weeks and will keep your data safe. You can unsubscribe at any time.
I created this website to help new Go developers, I hope it brings you some value! :)
You can follow me on Mastodon, Twitter/X or LinkedIn.
Thanks for reading!
Get 25% off on my upcoming guide
Gain access to exclusive content:
Save 25% when Structuring Go Web Applications by Value is launched.
Stay in the loop. I publish new articles every 1-2 weeks, get a heads-up when one is available.
I will keep your data safe. You can unsubscribe at any time.
I'm the Willem behind willem.dev and I approve of this message.