Skip to content

Glossary: Software Design Patterns in Go

Strategy

Also written: strategies, strategy pattern

One interchangeable way of doing a job, where all strategies have the same shape so the user doesn't care which it gets. In Go it is usually a function, such as a `Discount` chosen by `discountFor`.

Where the book teaches it

Related terms

Function typeClosure