Chapter 5. Functions in Go
One of Go's syntactical tour de force is via its support for higher-order functions as is found in dynamic languages such as Python or Ruby. As we will see in this chapter, a function is also a typed entity with a value that can be assigned to a variable. In this chapter, we are going to explore functions in Go covering the following topics:
- Go functions
- Passing parameter values
- Anonymous functions and closures
- Higher-order functions
- Error signaling handling
- Deferring function calls
- Function panic and recovery