Skip to content

Glossary: Software Design Patterns in Go

Template method

Also written: template method pattern

A pattern that fixes a job's steps in one place and leaves one step, the hook, for the caller to supply. In Go the hook is usually a function passed in, as with `formatRow` in `makeReport`.

Where the book teaches it

Related terms

Hookdefer