"A class should have one, and only one, reason to change."
–Robert C. Martin
–Robert C. Martin
Go doesn't have classes, but if we squint a little and replace the word class with objects (structs, functions, interfaces or packages), then the concept still applies.
Why do we want our objects to do only one thing? Let's look at a couple of objects that do one thing:
These objects are simple and easy to use, and have a wide range of uses.
Designing objects so that they all do only one thing sounds okay in the abstract....