Skip to content

Glossary: Software Design Patterns in Go

Function literal

Also written: func literal, anonymous function

An unnamed function written in place, such as `func(a, b Order) int {...}`. It can be stored in a variable or passed to another function like `slices.SortFunc`.

Where the book teaches it

Related terms

ClosureFunction type