Functions have types based on their parameters and return values. You can declare a function type and use it like any other type:
type operation func(int, int) int
func apply(a, b int, op operation) int {
return op(a, b)
}
The operation type represents any function that takes two ints and returns an int. This makes code more readable when you pass functions around frequently.