:todo write about managing callbacks

Functions are first-class values in Go:

Assigning functions to variables

https://codeeval.dev/gist/87fdc3f90307e8bec73a33f24028ba14

Passing functions as arguments

https://codeeval.dev/gist/9514f30e47d4708532d205a00b89fcfe

Common uses for function arguments:

Comparing functions

A function variable can only be compared to nil value.

You can't compare a function to another function.

Comparing functions has tricky corner cases so Go designers decided to not implement it at all.

Mocking functionality in tests

Sometimes it's hard to write tests for a piece of code.

Imagine you're writing a web service which needs to authenticate users.

In production deployment this requires looking up user information in the database.