##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Write reusable code with functions, closures, and defer
Welcome to Functions
The func keyword
Passing data in
More than one input
Test your knowledge
Getting data out
Go's signature feature
The blank identifier
Test your knowledge
Documenting returns
Returning named values
Test your knowledge
Variable arguments
Passing slices to variadics
Test your knowledge
How Go passes arguments
Modifying original values
Test your knowledge
First-class functions
Functions without names
Capturing variables
Seeing closures in action
Test your knowledge
Typing functions
Functions that take functions
Test your knowledge
Scheduling cleanup
LIFO stacking
Evaluation timing
Test your knowledge
Package initialization
When init runs
Functions calling themselves
Fibonacci numbers
Test your knowledge
Variable visibility
Organizing code
Test your knowledge
The Go pattern
The if err pattern
Test your knowledge
Functions on types
Idiomatic Go
Writing comments
Test your knowledge
Verifying correctness
Looking ahead
Key takeaways