Go Functions (Part 4) — Anonymous Functions

Photo by tofayel ahmed on Unsplash

Anonymous functions are functions without a name. They are also known as Function literals.

This article is part of the Functions in Go series

You define anonymous functions using the usual func keyword, but with a slightly different syntax. first as a reminder, here’s what a regular function’s syntax looks like: