Skip to content

Glossary: Software Design Patterns in Go

Single responsibility principle (SRP)

Also written: SRP, single responsibility

The SOLID principle that a piece of code should have one reason to change. Pulling `priceItems` and `applyDiscount` out of `placeOrder` is an example.

Where the book teaches it

Related terms

SOLIDCohesionGod object