Making Golang Packages Thread-safe

Photo by Serge van Neck on Unsplash

Concurrency is such a foundational capability of the Go language that it is effortless to write code that leverages multiple goroutines, sometimes without even knowing.

As an example, if you’ve ever used the net/http package to create a web service, you’ve used goroutines.

To handle incoming HTTP traffic, the HTTP Server will generate a goroutine for every connection and one…



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Benjamin Cane

Benjamin Cane


Distinguished Engineer @AmericanExpress building payments systems. Author:, Thoughts, & Opinions are my own.