Making Golang Packages Thread-safe
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…